2.3 Producing Robust Programs Flashcards
What is anticipating misuse?
Misuse of a program could be deliberate (a hacker trying to get into a system by making it crash) or accidental (a user forgetting their password)
What is authentication?
The process of a user confirming that they are who they say they are
Range check example
A number or date is within a sensible/allowed range
Length check example
Text entered is not too long or too short e.g. between 8-15 characters
Type check example
Data is of the right type e.g. integer
Presence check example
Checks that data has been entered i.e. the field hasn’t been left blank
Format check example
Checks that the format of, for example a postcode or email address, is correct
What can validation do?
Check that data which has been entered is reasonable
What is verification used for?
To double-check that data has been typed correctly (human errors)
What are some features of subprograms?
- Written so that they can be reused multiple times in the program and easily transferred to others
- Makes debugging easier as it can be tested and edited separately
What do naming conventions do?
Help to identify variable names by using meaningful and consistent format for them to aid readability
What do indentations do?
Aid readability so it is clear where iterations and selections start and end
What are some features of commenting?
- Help other programmers to understand your code
- Who wrote it, when and its purpose
- Comment complex coding sections and subroutines
Why is testing needed?
To ensure the program functions as expected and meets all requirements. It should be destructive aiming not only to prove the function but also break it
What is iterative testing?
- Tests modules and parts of the program for development
- Errors in each module need to be fixed before moving to the next
- Tests and retests subprograms separately