Defensive Design + Errors and Testing Flashcards
What can Data Validation routines do?
Ensure that data entered is of the right type.
What can Validation not do?
Ensure that the user has not made a spelling error or entered the wrong value.
What can Validation ensure?
Validation can only check that the data entered is reasonable.
What does Data Verification do?
Verification is used to double check that the data has been typed in correctly.
What is double entry verification?
A good example of double entry verification is when two passwords don’t match their password will be needed to be rentered.
What is Authentication?
Confirm that the person is who they are.
What are some common examples of Authentication?
Commonly, you are asked to enter a username and password.
You may also be asked to confirm these details on a separate device (2FA).
Why do Programs need to be maintained?
This will be to improve the code, fix bugs or add new features.
What are some examples of things that appear in maintainable programs?
Use of subprograms (functions + procedures)
Using appropriate naming conventions
Indentation
Commenting
What do subprograms include?
Functions and Procedures.
Will Subprograms take inputs?
Yes, well written subroutines will take inputs through parameters and if necessary return a value.
What makes a well written subprogram?
They should be written so they can be reused multiple times in the program.
Can you have the same function and variable name?
NO, this is inappropriate naming conventions.
Can you have the same function and variable name?
NO, this is inappropriate naming conventions.
Why does indentation improve code?
Indentation makes it possible to easily see which lines of code are part of different structures.
Why are comments usually written?
Parts of the program that are difficult to understand.
At start of function or procedure to explain what it does/.
What is a syntax error?
An error where the code written does not conform to the rules of the language,
Can interpreters and compilers execute the code if there is a syntax error?
No, they will not know how to translate the flawed program into machine code so it will give the programmer a syntax error.
What is a logic error?
Produces an unexpected output, the IDE will not detect the error.
Can interpreters and compilers run with logic errors?
Yes, the code will still run fine but it will produce an unexpected output.
What are the three types of testing?
Normal
Boundary
Erroneous
When is iterative testing carried out?
During the development of the program.
When is final testing carried out?
After the program is complete.
When is final testing carried out?
After the program is complete.