SYLLABUS 7.6 · PAPER 2 · ALSO FOR 0984 AND 2210

Test data: normal, abnormal, extreme and boundary

Test data is chosen to check that a program accepts what it should and rejects what it shouldn’t. Questions usually give a validation rule, such as “a whole number from 11 to 16”, and ask for examples of each kind of test data with the expected result.

The four kinds

  • Normal: sensible data the program should accept, such as 13 for an age from 11 to 16.
  • Abnormal: data the program should reject, either out of range or the wrong type, such as 25, −4 or “twelve”.
  • Extreme: the largest and smallest values that should still be accepted, here 11 and 16.
  • Boundary: a pair of values on each side of a limit, one accepted and one rejected. For the upper limit that is 16 (accepted) and 17 (rejected); for the lower limit, 11 and 10.

Choosing values

Read the rule carefully. “From 11 to 16” includes both ends, while “more than 11” does not. For a real number to one decimal place, the value just outside the limit is 0.1 away, not 1: for 2.5 to 9.0, the upper boundary pair is 9.0 and 9.1.

Always say what should happen: accepted or rejected. The expected result is part of the answer, and it is how the test is judged.

Where marks go

  • Giving an extreme value that is outside the range. Extreme values must be accepted.
  • Giving only one value for boundary data instead of the pair either side of the limit.
  • Using a step of 1 for real numbers, where the next value is 0.1 or 0.01 away.
  • Leaving out the expected result.
  • Choosing abnormal data that the rule would actually accept.

Try a question

6 MARKS · MARKED ON THIS PAGE

A school chess club program accepts a pupil's age only if it is a whole number from 11 to 16 inclusive. Complete the table by writing the type of test data for each value. Use exactly one of these words: normal, abnormal, extreme, boundary. Boundary data is really a pair of values at a limit (the last accepted value and the first rejected value). In this table, label only the rejected value of that pair as boundary. Use these meanings: - extreme: a valid value exactly on a limit (it is accepted) - boundary: the invalid value immediately beyond a limit (it is rejected) - abnormal: any other value that should be rejected - normal: any other value that should be accepted

ValueType of test data
14
11
17
3
fifteen
16
Fill in your answer first.