2.3 Producing Robust Programs Flashcards
(10 cards)
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 Verification
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 the main reason for testing and 3 other reasons
- To ensure the program works no matter what data is inputted
Other reasons: So the program meets the requirements, To make sure there are no bugs, To make sure program is secure against malware
Explain a difference between iterative and final testing.
Iterative:
- used when program is being developed
- individually tests each program until it works as expected
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