Validation and verification Cambridge IGCSE Computer Science (9–1) revision
Not started
Learn it
In plain words
Rubbish in, rubbish out. A program that accepts an age of 250 or a blank name will produce nonsense, so data is checked as it is entered. There are two kinds of check, and they answer different questions.
Validation asks: is this data sensible? Verification asks: is this what was meant to be typed?
6 things to know
- Validation is an automatic check by the program that data is reasonable and follows the rules, before it is accepted.
- Range check: the value lies between two limits. Length check: it has the right number of characters. Type check: it is the right kind of data, such as a number.
- Presence check: something has been entered, and the field is not left empty. Format check: it follows a pattern, such as two letters and then four digits. Check digit: the extra digit calculated from the others matches.
- Validation cannot tell whether data is correct. An age of 61 typed for a 16-year-old passes a range check.
- Verification checks that data has been copied accurately from its source.
- Visual check: the user reads what was entered and compares it with the original. Double entry check: the data is entered twice, and the two versions are compared.
Worked example
A form asks for a PIN that must be exactly four digits. Which validation checks should be used?
- Something must be entered: a presence check.
- It must be made of digits only: a type check.
- It must have exactly four characters: a length check.
Tips and tricks
- Validation: is it reasonable? Verification: was it copied correctly? Neither proves the data is true.
- Name the check and say what it tests, using the data in the question: "a range check, so that the mark is between 0 and 100".
It lands in your notebook with its questions as flashcards.
Validation and verification: 6 questions and answers
These are the quiz’s questions. Do the quiz first, then come back here for the ones that got you.
Which check makes sure a mark is between 0 and 100?
It tests against a lower and an upper limit.
Which check makes sure a field has not been left empty?
Something must be present.
Which check would make sure a code is two letters followed by three digits?
It tests the pattern of the characters.
Which of these is a verification check?
The data is typed twice and the two are compared.
A user is asked to type a new password twice. This is:
The two entries are compared.
A 16-year-old types her age as 61. The program accepts ages from 11 to 99. Why is the mistake not caught?Stretch
61 is inside the range, so it passes.
Quiz
6 questions
Tap an answer and you’ll see straight away whether it’s right, and why.
Worksheet
3 questions, 7 marks. Write your answers on paper, then check them.
Validation and verification
Cambridge IGCSE Computer Science (9–1) 0984 · 7 marks · papermunch.org
Name ______________________________ Date ______________
Describe the difference between validation and verification.[2]
Show answerHide answer
Validation is an automatic check that data is reasonable and obeys the rules. Verification checks that data has been entered accurately, matching the original.
A program asks for a month as a number. State three validation checks that could be used and what each would check.[3]
Show answerHide answer
A range check, that the number is from 1 to 12. A type check, that it is a whole number. A presence check, that something has been entered.
Describe how a double entry check works.[2]
Show answerHide answer
The data is entered twice. The two entries are compared, and if they differ the user is asked to enter the data again.
Answers: Validation and verification
- 1. Validation is an automatic check that data is reasonable and obeys the rules. Verification checks that data has been entered accurately, matching the original.
- 2. A range check, that the number is from 1 to 12. A type check, that it is a whole number. A presence check, that something has been entered.
- 3. The data is entered twice. The two entries are compared, and if they differ the user is asked to enter the data again.



