Menu

Testing

Test Data Types

Test data is the data you choose to run a program with to check that it works. The four types are normal, boundary, invalid and erroneous.

Normal test data is typical, sensible data of the correct type. The program should accept it without causing an error. For a program that takes a whole number of fish in a tank and only accepts 3 to 10, normal data could be 6.

Boundary data

Boundary test data has the correct data type and sits on the very edge of being valid: it uses the two values right at the ends of the allowed range: the smallest and largest numbers the program should allow. For the fish tank, the boundary values are 3 and 10. Boundary data is valid, so it may also be described as normal data. Testing values just outside the valid edge is good practice: 2 and 11 are invalid data because they are the right type (whole numbers) but the wrong value (outside the accepted range). The program should reject them.

Invalid and erroneous data

Invalid test data is of the correct data type but should be rejected by the program. It has the right type but the wrong value, such as 2 or 11 above. Erroneous test data is of the incorrect data type and should also be rejected. It has the wrong type, such as "six" (text) or 5.5 (a decimal) when the program expects a whole number.

TypeExample for 3 to 10 fishWhy
Normal6Typical whole number inside the range
Boundary3 or 10Valid edge whole number
Invalid2 or 11Whole number, but outside the range
Erroneous"six" or 5.5Wrong data type

Suitable test data must match the data type and valid range described in the scenario. Give actual values, not descriptions: 6 is test data, but "a number between 3 and 10" is not.

A number line from 1 to 12 with the valid range 3 to 10: 6 is normal, 3 and 10 are boundary, 2 and 11 are invalid, and text such as six or a decimal such as 5.5 is erroneous.

Practise this