Producing Robust Programs Flashcards
How do programmers protect their programs
Testing - to reduce the number of errors
Prediction of how users may misuse their program and maintaining programs.
Input sanitisation
removes any unwanted charecters
Input Validation
Checks it the data is valid and can be passed into a program
Presence Check
Checks to make sure data has been entered.
Length Check
Checks if the data is the correct length
Range check
checks to see if the data is within the correct range
Format check
Checks it is in the correct format
Check digit
checks to see if numerical data has been entered correctly.
Look up table
Checks against a table of accepted values
Authentication
Where a program confirms the identity of a
user before giving them access to the full program. This could
be done through usernames and passwords.
Maintainability
Well maintained code is easy to edit without making any errors.
Good code will contain: comments, appropriate names for variable and subprograms and indentation.
Why test a program
To make sure there are no errors
Final/ Terminal Testing
The program is tested in one go at the end of production
Iterative testing
The program is tested at regular intervals that means that it is made sure that the program is working all the time.
Types of Test data
Normal - Normal data
Boundary - Data close to the edge
Erroneous - data outside the limit