2.3 Producing Robust Programs Flashcards
What is a check digit?
The last one or two digits in a code are used to check the other digits are correct
E.g. bar code readers in supermarkets use check digits.
What is a format check?
Checks that the data is the correct format.
E.g. National Insurance Number in the form LL 99 99 99 L where L is any letter and 9 is any number.
What is a length check?
Checks that the data isn’t too short or too long.
E.g. a password needs to be more than 8 characters.
What is a lookup table?
Looks up acceptable values in a table.
E.g. there are only 7 possible days of the week.
What is a presence check?
Checks that data has been entered into a field.
E.g. in most databases, a key field card can’t be left blank.
What is a range check?
Checks that a value falls within a specific range.
E.g. number of hours worked (h):
0 < h < 50
What is a spell check?
Looks up words in a dictionary.
E.g. Microsoft Word underlines incorrectly spelled words in red.
Define authentication
A coding method to check that a user is who they say they are and allowed to accesses the program.
The program checks a huge table and reports back to see if the information matches up, if it does then the access is granted
E.g.biometrics, key cards or email.
Define input sanitisation
Ensures that the input is correct and contains only the permitted characters letters and symbols.
E.g. Dave not Dav%e so the % would be removed.
Define maintainability
If a program is to be defensive against attacks, then it has to be maintained and up to date.
Informs the reader of a bug or issues.
Explains the code and its function in more detail.
Stop a line of section of code from executing.
E.g. comments and indentation/spacing.
Define misuse
Maybe in the form of a brute force attack on the program.
Unauthorised acts with intent to impair the operation of the computer.
Define iterative testing
Testing the code as you create it.
E.g. line by line or a section at a time.
Define final testing
Carried out at the end of the program when it has been written.
Define syntax errors
Mistakes in the formatting (the way in which the code is written).
E.g. SPAG mistakes or unneeded capital letters.
Define logic errors
A bug in a program that causes it to operate incorrectly, but not to terminate or crash (not as intended).