2.3 Producing Robust Programs Flashcards
What are the 5 Input Validation checks?
Range Check
Type Check
Format Check
Presence Check
Length Check
Explain the range check
Checks data is within a certain range, usually numbers
Explain the format check
Checks data is entered in a certain way
Explain the presence check
Checks data has been entered and not left blank
Difference between Input Sanitisation, Validation and Authentication
Input Sanitisation is cleaning up input data to reduce redundancy or remove malicious code.
Validation is checking whether input data follows specific criteria and should be accepted.
Verification is checking whether data that has been entered is correct.
What are 5 ways of making a program more maintainable?
- Using constants,
- Using subprograms
- Using indentation
- Appropriate variable names
- Add comments
This improves readability and ease of debugging
Give 2-4 reasons for the purpose of testing
- To ensure there are no bugs
- To ensure unauthorised access is prevented
- To check the program has an acceptable performance
- To check the program meets the requirements
Explain a difference between iterative and final testing.
Iterative:
- used when program is being developed
- programmer develops a module and tests it repeatedly until runs as intended
Final:
- used when program is finished
- tests with normal, boundary, invalid and erroneous data
- used only after each module has been tested
Define syntax error.
- when there is a mistake in the grammar of the programming language
- the program will not execute
Define logic error.
- the program will run/be executed but produces an unexpected output