2.3 - Programming Robust Programs Flashcards
Name some defensive design considerations
- Anticipating misuse
- Input sanitisation
- Validation
- Verification
- Authentication
- Maintainable code
How can anticipating misuse help in defensive design considerations?
Planning ahead to take steps against potential misuse
How can inputting sanitisation help in defensive design considerations?
Cleaning up data that has been input
What is Validation?
A process to check that data is reasonable or sensible before it is accepted
What is Verification?
Checking whether data has been entered correctly
What is maintainable code?
Allowing other programmers to understand the code
Give some examples on maintainable code
- Comments
- Indentation
- Meaningful variable names
How can authentication help in defensive design considerations?
Ensuring only authorised users can gain access to a system
What are the types of input validation?
- Range
- Type
- Format
- Presence
- Lookup Table
- Length
What is a Range check?
Checks data is within a certain range
What is a Type check?
Checks data is a certain data type
What is a Format check?
Checks data is entered in a certain way
What is a Presence check?
Checks that data has actually been entered and not left blank
What is a Lookup Table?
A table of acceptable entries
What is a Lookup table also known as?
A List