Validation, Verification & Testing

💻 Computer Science Years 9–11 Foundation

Checking data is sensible with validation, checking it was entered correctly with verification, and choosing normal, boundary and abnormal test data.

Open this lesson, with practice and a printable worksheet →

A program is only as trustworthy as the data you feed it. Type your age as "-7" or your email as "banana" and, without checks, the program will happily store nonsense — and rubbish in means rubbish out. Two guards stand at the door: validation, which asks "is this data sensible?", and verification, which asks "was this data entered correctly?". Then careful testing proves the guards actually work.

Why this matters: Validation and verification keep real systems safe and accurate, from online forms to bank records. Cambridge expects you to name validation checks, distinguish validation from verification, and choose normal, boundary and abnormal test data.
VALIDATIONis the data sensible?• range check• length check• type check• presence / format• check digitVERIFICATIONwas it entered correctly?• double entry• visual (screen) check
Validation asks if data is sensible; verification asks if it was entered correctly.

Validation checks

Validation is an automatic check the computer performs to make sure data is reasonable before it is accepted. It cannot prove data is correct — only that it is plausible.

CheckWhat it testsExample
RangeValue between limitsAge 0 to 120
LengthRight number of charactersPassword ≥ 8 characters
TypeCorrect data typeAge must be an integer
PresenceA value was enteredSurname not left blank
FormatMatches a patternDate as DD/MM/YYYY
Check digitExtra digit recomputesISBN, barcode

Verification

Note that verification does not make data correct either — you can carefully type the wrong number twice.

Test data: normal, boundary, abnormal

110050 (normal)boundaryboundary0 abnormal101 abnormal
For a range 1–100: normal 50, boundary 1 and 100, abnormal 0 and 101.

Testing a validation routine

A trace table lets you follow test data through a routine and check the output. Testing with all three types of data gives confidence the routine handles every case.

Test dataTypeExpected result
50NormalAccepted
1Boundary (lowest valid)Accepted
100Boundary (highest valid)Accepted
0AbnormalRejected
150AbnormalRejected
Worked example (State + apply, 3 marks): A field accepts marks from 0 to 100. Give one item of normal, boundary and abnormal test data.
Normal: 55 (a typical valid mark, accepted).
Boundary: 0 or 100 (the exact edges, accepted); or -1 / 101 (just outside, rejected).
Abnormal: 250 or "pass" (clearly invalid, rejected).
Common mistake: Saying validation guarantees the data is correct. It does not — "Jhon" passes a presence and type check but is still a misspelling. Validation checks data is sensible, not true. Verification (double entry) catches typing slips but still cannot prove truth.

Memory hook: Validation = Valid/sensible, Verification = Verify it was copied right. For test data remember N-B-A: Normal, Boundary, Abnormal.

Get the printable worksheet →
← Logic Gates & Circuits → Computational Thinking
← Sasta Basta home All subjects