Revise Computingrevisecomputing.co.uk
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates

Knowledge organisers / Testing

Selecting and using suitable test data: Normal; Boundary; Invalid/Erroneous

All topicsPractise exam questions
Knowledge organiser

Testing

2.3.2d

Normal test data as data which should be accepted by a program without causing errors; Boundary test data as data of the correct type which is on the very edge of being valid; Invalid test data as data of the correct data type which should be rejected by a computer system; Erroneous test data as data of the incorrect data type which should be rejected by a computer system; Ability to identify suitable test data for a given scenario; Ability to create/complete a test plan

What you need to know

When testing a program, you should use three types of test data. Normal data is typical data that should be accepted. Boundary data tests the very edges of valid ranges. Invalid/erroneous data should be rejected by the program. Using all three types ensures thorough testing that covers normal use, edge cases, and misuse.

Key points

  • Normal test data: typical, expected input that the program should accept and process correctly (e.g. 3 for range 1-5).
  • Boundary test data: values on the very EDGE of a valid range. For range 1-5 inclusive: test with 1 and 5 for VALID boundary, or 0 and 6 for INVALID boundary.
  • Invalid test data: correct data type but outside the acceptable range (e.g. 0 or 6 for range 1-5).
  • Erroneous test data: wrong data type entirely (e.g. "bananas" when a number is expected).
  • Normal and boundary data should be accepted; invalid and erroneous data should be rejected.
  • Exam Tip:Give specific test data VALUES (e.g. 50), not descriptions (e.g. 'a value between 40 and 180'). Descriptions do not score marks.
  • Exam Tip:For boundary data that should be VALID (accepted), choose the exact boundary values (e.g. 40 or 180 for range 40-180 inclusive). NOT 39 or 181 if the expected output says 'VALID'.
  • Exam Tip:Erroneous data can be a non-numeric value like "bananas" when a number is expected.
  • Exam Example:For range 1-5 inclusive: Normal = 2 (ALLOWED), Boundary = 1 or 5 (ALLOWED), Erroneous = 7 or "hello" (NOT ALLOWED).
  • A test plan documents the test data, type of test, expected results, and actual results.

Code examples

Test data for range 1-100
python
# Testing input validation for range 1-100:
#
# Normal:     50      -> Accept
# Boundary:   1       -> Accept (lower edge)
# Boundary:   100     -> Accept (upper edge)
# Invalid:    0       -> Reject (just below)
# Invalid:    101     -> Reject (just above)
# Erroneous:  "hello" -> Reject (wrong type)
# Erroneous:  -5.5    -> Reject (wrong type)