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
What is the purpose of testing?
To ensure the program runs as intended by removing all syntax and logic error
What are the two types of testing?
- Iterative testing
- Final testing
What is another name for final testing?
Terminal testing
When is iterative testing done?
When a program is being developed
When is final testing done?
When a program is complete
How does iterative testing work?
- After a module of code is written it is tested
- The code will then be edited
- This process repeats until the module works as intended
What is final testing?
When the entire program is tested to see if it works as intended
What are the 4 different data types used in testing?
- Normal data
- Boundary data
- Invalid data
- Erroneous data
What is normal test data?
Data which should be accepted by the program without causing errors
What is boundary data?
Data of the correct type which is on the very edge of being valid
What is invalid test data?
Data of the correct type which should be rejected by a computer system
What is erroneous data?
Data of the incorrect type which should be rejected by a computer system
How can you record testing?
With a test table
What columns should be on a test table?
- Test number
- Description of what is being tested
- Test data being used
- Type of test data
- Expected result
- Actual result