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

CheckWhat it testsExample
RangeThe value is between a lower and an upper limitAge from 11 to 18
LengthThe number of characters is exact, or within limitsPassword of 8 to 20 characters
TypeThe data is the right data typeQuantity must be a whole number
PresenceData has been entered, not left blankEmail address must be filled in
FormatThe data matches a set patternProduct code of two letters then four digits, e.g. AB1234
Check digitAn extra digit calculated from the others detects input errorsThe 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 <= 100
Check both limits with OR inside the IF, and the opposite condition with AND in the UNTIL. Getting these the wrong way round is the most common error in this code.

4. 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 dataExample valuesExpected result
Normal56Accepted
Abnormal-5, 150, “ten”Rejected
Extreme0 and 100Accepted (largest and smallest valid values)
Boundary0 and -1, 100 and 101The 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 →

Was this page helpful?