Every student in a school is assigned an id number.
When searching for a student in a database, a valid id must be entered. Valid ids:
Any id that does not follow these rules is invalid.
Enter some valid and invalid student ids and see what happens:
Can you see what is happening?
Code has been written to check the data entry. The code asks are you valid? and if the input is not valid an error message appears and the user has to try again.
These methods of checking valid or invalid data entry are known as validaiton checks.
| check | description | |
|---|---|---|
| length check | to check that the length of the input string is valid. | |
| presence check | to check that there is any data present when input. | |
| format check | to check that the data is in the correct format eg 12:34:00 for time data, not 12;34;00 which is invalid. | |
| range check | to check that numerical data, eg somebody's age, is within a certain range eg 13-19 for a teenager. | |
| type check | to check that the data type is correct, eg we cannot enter hello (a string) when we should enter someone's age (an integer). |
Verification checks are different from validation checks.
Validation checks make sure that the correct kind of data is being entered.
Verification checks make sure that the correct data is being entered.
For example, huge businesses store massive amounts of data. If incorrect data is entered into systems, big problems can occur. Imagine if a banker entered $1,000,000 instead of $1,000 into a system! Both numbers might be valid, but only one is correct.
Here are some common types of verification checks: