Producing Robust Programs Flashcards
What is the purpose of defensive design?
To ensure that a program runs correctly and continues to run no matter what actions a user takes
State 4 methods of creating a defensive design
- Validation
- Authentication
- Maintenance
- Testing
What is data sanitisation?
Hiding or protecting data so it cannot be seen or disclosed
What is validation?
The process of ensuring an input is possible and sensible
Give 5 examples of checks that can be done to validate an input
- Range check
- Presence check
- Length check
- Format check
- Type check
What is a range check?
A check that ensures an input is within a specified range
What is a presence check?
A check to see if anything was inputted
What is a length check?
A check that ensures an input isn’t too long or short
What is a format check?
A check to ensure the input is in the right format
What is a type check?
A check to ensure the input is in the specified data type
What is authentication?
The process of ensuring a person is who they say they are
Name 3 ways of authenticating a user
- Usernames & passwords
- Biometrics
- PIN number
Name 4 ways of making a program maintainable
Using:
- Comments
- Naming conventions
- Indentation
- Using subprograms
What are the two types of subprogram?
- Functions
- Procedures
What is the difference between a function and a procedure?
Functions return a value, procedures do not