Skip to content
Learnearn.uk » A Level Computer Science Home » Choosing Test Data

Choosing Test Data

Testing Data

Choosing Testing Data

It is important that you choose test data that simulates a wide variety of usage and especially that you choose data that tests the three types of test data:

  • Normal
  • Abnormal
  • Boundary / Extreme

When White Box Testing, as you have access to the source code, you should ensure that your test data covers all the possible programs paths for that function or module.

Example

age = input("How old are you?")
if not age.isdigit():
    print("Age must be a whole number")
elif int(age) < 0:
    print("Age must be greater than or equal to zero")
elif int(age) < 10:
	print("You are young")
elif int(age) > 70:
	print("You are old!")
else:
	print("You are a normal age")

In the code above there are 5 possible paths in the program to test and so your test data should probably include values  such as:

  • 2.5
  • -1
  • 5
  • 20
  • 100

Normal

Abnormal

Boundary / Extreme

Resources