Producing robust programs Flashcards
What is the purpose of defensive design
Ensures a program runs correctly and continues to run no matter what actions the user takes
What is authentication
The process of the user confirming they are who they say they are on a computer system
How is authentication done
- username + password, bank account number
- secret answer to a question
- biometrics, physical identifier
What does validation do
Helps a programmer ensure that any data input is possible and sensible. It applies rules to the inputted data and if they are not met the data is rejected
What are the validation checks
- Range checks
- Length check
- Presence check
- Format check
- Type check
What is the purpose of maintainability
To ensure that over time a program can be easily maintained and understood
How can code be made easier to understand
- Comments
- Naming conventions
- Indentations
How do comments make code easier to understand
Provide information about what different parts of the program does
How do naming conventions make the code easier to understand
Meaningful variable names reflects the purpose of the variable and the data that it intends to hold
How do indentations make the code easier to understand
Codes within selections or iterations should be indented, allows the programmer to see which parts of the code falls in the selection or iteration and when it ends
What is used in defensive design
- Maintainability
- Authentication
- Validation
What are the two methods that testing is carried out by
- Final (terminal) testing
- Iterative testing
What is iterative testing
testing carried out while the program is being developed
The programmer writes a second of code then tests it
What is final testing
testing is carried out once all the modules are complete
the program is tested as a whole to ensure it functions properly
What is test data used for
to test whether or not a program is functioning correctly