REVISION GUIDE · IGCSE 0478 AND A LEVEL 9618
Validation and verification checks explained
The six validation checks with examples, how verification is different, a range check in pseudocode, and how to choose test data.
1. Validation or verification?
Validation is an automatic check by the computer that data is sensible and follows the rules, for example that a mark is between 0 and 100. It cannot tell you the data is correct: a mark of 65 passes even if the student really scored 56.
Verification checks that data has been entered or copied accurately, matching the original.
2. The six validation checks
| Check | What it tests | Example |
|---|---|---|
| Range | The value is between a lower and an upper limit | Age from 11 to 18 |
| Length | The number of characters is exact, or within limits | Password of 8 to 20 characters |
| Type | The data is the right data type | Quantity must be a whole number |
| Presence | Data has been entered, not left blank | Email address must be filled in |
| Format | The data matches a set pattern | Product code of two letters then four digits, e.g. AB1234 |
| Check digit | An extra digit calculated from the others detects input errors | The last digit of an ISBN or barcode |
3. A range check in pseudocode
Paper 2 often asks you to write validation. A REPEAT loop keeps asking until the input is acceptable.
REPEAT
INPUT Mark
IF Mark < 0 OR Mark > 100
THEN
OUTPUT "Mark must be between 0 and 100"
ENDIF
UNTIL Mark >= 0 AND Mark <= 1004. Verification methods
- Double entry: the data is typed twice and the computer compares the two copies, as when you set a new password.
- Visual check: the user reads the data on screen and compares it with the original document.
When data is sent between devices, other checks confirm it arrived unchanged: parity checks, checksums and echo checks. These appear in the data transmission topic.
5. Choosing test data
For a range check that accepts 0 to 100:
| Type of test data | Example values | Expected result |
|---|---|---|
| Normal | 56 | Accepted |
| Abnormal | -5, 150, “ten” | Rejected |
| Extreme | 0 and 100 | Accepted (largest and smallest valid values) |
| Boundary | 0 and -1, 100 and 101 | The valid value is accepted, the value just outside is rejected |
6. Mistakes that cost marks
- Saying validation makes sure data is correct. It only checks the data is reasonable.
- Giving “double entry” as a validation check. It is a verification method.
- Naming a check without an example linked to the scenario in the question.
- Writing
IF Mark > 0, which wrongly rejects the valid value 0.
7. How to practise
The IGCSE Programming page covers validation code with self-marking questions, and the A Level Security, privacy and data integrity page goes further for 9618. For “describe” and “explain” questions, see the command words guide.
Frequently asked questions
What is the difference between validation and verification?
Validation is an automatic check that data is sensible and follows set rules. Verification checks that data has been entered or copied accurately from its source.
Is a check digit validation or verification?
A check digit is a validation check. The computer recalculates the digit from the other digits and rejects the input if it does not match.
What is the difference between extreme and boundary test data?
Extreme data is the largest and smallest values that should be accepted. Boundary data tests each limit from both sides: the last valid value and the first invalid value next to it.
Want help with validation questions? In a 1-to-1 lesson we can write validation code and practise test data questions together. Book a free demo →