T8 - Defensive design Flashcards
Data validation use
-ensures that data entered is of the right type
-conforms to a set of rules
-only check that the data entered
is reasonable
Data validation cannot ensure
hat the user has not entered a wrong value, or made a spelling mistake in a name
Range check
-number or date is within correct/sensible range
length check
checks that text entered is of correct length
-not too short/long
type check
check data is correct type (interger/boolean)
Presence check
ensures data has been entered
-detects blank regions
eg of length check
password must be between 5 and 12 characters
Verification
is used to double-check that the data has been typed in correctly
Verification eg
a user setting a new password may be asked to type it in twice
Double-entry verification:
If the two passwords don’t match, they will be asked to enter the password again
Authentication routines
are used to make sure a person is who they claim to be
Brute-force attack:
software programs try out every combination of letters, numbers and special characters
ways to prevent brute force attack
Use a password of 8 characters or more to make it more difficult to hack!
maintaining code meaning
improve the code, fix bugs or add new features to the program
factors that make maintenance easier
- The use of sub programs
- Using appropriate naming conventions
- Indentation
- Commenting