Creating Robust Programs Flashcards

1
Q

What is anticipation and protection done through?

A
Validation 
Sanitation
Authentication
Maintenance
Testing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a defensive design?

A

A program that runs correctly and continues to run no matter the user input.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How may programers apply defensive design?

A

Anticipating how users may misuse their program then attempt to prevent it
Ensure their code is well maintained
Minimising the number of errors through testing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the best way to prevent a user from accidentally or intentionally misusing a program when entering data?

A

Through input validation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is validation?

A

Checking if data meets certain criteria before passing into the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Name the different types of validation.

A
Range check
Presence check
Format check
Look up table
Length check
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Describe what a range check does?

A

Checks the data is within a specified range

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe what a presence check does?

A

Checks the data has actually been entered

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Describe what look up table does

A

Checks the data against a table of acceptable values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe what a length check does

A

Checks the data is the correct length

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Karen wants to validate usernames for an online forum. She wants each username to be longer than five characters and start with an upper case letter.
Give two validation checks Karen would need to use.

A

Length check - to make sure the username is not longer or shorter than the length allowed
Format check - To make sure the username starts with an uppercase letter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Name a reason for authentication

A

Authentication helps protect your programs
It can confirm the identity of a user before they’re are allowed to access certain pieces of data or features of a program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are common ways to increase the security of a password based authentication system?

A

Force users to use strong passwords and have them change passwords regularly
Limit the number of failed authentication attempts before access to an account is lost
Ask for a random selection of characters from the password on each authentication

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Why is it important to get the level of authentication correct?

A

Too much authentication can affect a programs functionality and put people off using it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Name two different types of errors

A

Syntax errors

Logic errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a syntax error?

A

An error in the code where the rules or grammar of the programming language have been broken

17
Q

What is a logic error?

A

When a program does something that was not intended