Validation, verification and test data

Computer Science · Algorithm design and problem-solving. The idea in plain words, the rules to remember, the mistake to avoid and a worked example, written and checked by Mega Lecture.

Test this topic freeAll Computer Science topics

The idea

Validation is an automatic check by the program that data is reasonable and follows the rules before it is accepted. It cannot tell whether the data is correct: an age typed as 43 in place of 34 still passes a range check.

Verification checks that data has been entered or copied without change. It compares what was entered with the original. The two methods are a visual check and a double entry check.

Test data is chosen to show that a program works. A good test uses data the program should accept, data it should reject, and data at the limits of what is allowed.

Rules to remember

Common mistake

Students mix up extreme and boundary data. Extreme values are both accepted; a boundary pair has one accepted value and one rejected value.

Worked example

A program accepts a student's age as a whole number from 11 to 18 inclusive. Give normal, abnormal, extreme and boundary test data.

  1. Normal: any value well inside the range, for example 14, which should be accepted.
  2. Abnormal: a value that should be rejected, for example 25 or the word 'twelve'.
  3. Extreme: the smallest and largest accepted values, which are 11 and 18.
  4. Boundary: 10 and 11 at the lower limit, 18 and 19 at the upper limit. 10 and 19 are rejected.

Answer: Normal 14; abnormal 25; extreme 11 and 18; boundary 10 with 11, and 18 with 19.

Ask about this

Type what you are stuck on. The helper finds the explanation, worked examples and the notes to read, free and instant.

Keep going

← Standard methods of solutionTrace tables and correcting algorithms →Take a Computer Science test