← IGCSE Computer Science Paper 2

Test data

The input values chosen before testing, such as normal, abnormal, extreme and boundary values, used to run a program so its results can be compared with the expected results.

Understanding Test data in IGCSE Computer Science Paper 2

What it does: 1 and 10 are the edges of the range that are accepted, while 0 and 11 are just outside and should be rejected. The input and the expected result are written down before the test, so the actual output can be compared with it. Abnormal data should be rejected, such as the wrong data type. 13 is valid, so it is normal data. The four types of test data cover typical, invalid and limit values, so errors can be found and fixed.

Common mistakes: 150 is outside the range 1 to 100, so it is abnormal data and would be rejected. Normal test data must be inside the range, for example 50. 55 is inside the range 1 to 100, so it is normal data and would be accepted. Abnormal test data must be outside the range, for example -5.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 60–70) and word search (Modules 47–70).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which describes test data?
The final output a program prints after it has been released to usersInput values chosen before testing so results can be compared with expected results
Matches
Range 1-10, normal test data: 11
↓
11 is outside the range, so it is abnormal data not normal data. Normal data should be a valid value such as 5.
Applying
Meanings
Term
test data
Meaning
The input values chosen before testing, such as normal, abnormal, extreme and boundary values, used to run a program so its results can be compared with the expected results.
Practice
// Range check: Age 1 to 120
Testing
Gaps
// Test data 50 is data
Check Answer
Spots
2// Normal test data
3TestData ← 150 // accepted

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Squirrel' badge — Module Hoarder, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which describes test data?
A. Input values chosen before testing so results can be compared with expected results ✓
B. The final output a program prints after it has been released to users
Test data is chosen in advance, and the program's results are compared with what you expected.
2. A program accepts ages from 12 to 18. Which is normal test data?
A. abc
B. 15 ✓
Normal data is valid and should be accepted. 15 is inside the range 12 to 18. 'abc' is abnormal data.
3. A program accepts ages from 12 to 18. Which is abnormal test data?
A. twelve ✓
B. 13
Abnormal data should be rejected, such as the wrong data type. 13 is valid, so it is normal data.
4. When should test data be chosen?
A. After the program runs, by looking at whatever it outputs
B. Before the testing starts, along with the expected results ✓
If you pick the data first and write down the expected results, you can fairly judge the program's actual results.
5. A mark must be between 0 and 100. Which pair are the extreme values of the accepted range?
A. 0 and 100 ✓
B. -1 and 101
Extreme data is the largest and smallest values that are still accepted. -1 and 101 are just outside, so they are boundary data that should be rejected.

Match the Pairs

Range 0-100, test data: 50 → Normal test data: a valid value that should be accepted
Range 0-100, test data: -5 → Abnormal test data: an invalid value that should be rejected
Boundary test data uses the values at the edge of the accepted range and the values just outside it → Range 1-10, test data: 1, 10, 0, 11
Test data is chosen before testing, with an expected result written for each value to compare with the actual result → Input: 150 | Expected: Rejected
Range 1-10, normal test data: 11 → 11 is outside the range, so it is abnormal data not normal data. Normal data should be a valid value such as 5.
Range 1-100, test data 1, 50, 100: all rejected → These values are inside the range (1 and 100 are boundary values), so they should be accepted, not rejected.

Key Term

test data
The input values chosen before testing, such as normal, abnormal, extreme and boundary values, used to run a program so its results can be compared with the expected results.

Fill in the Blanks

1. // Valid age is 1 to 100 // Test data 50 is normal data
Hint: Type the test data type for a typical value that should be accepted.
2. // Valid age is 1 to 100 // Test data -5 is abnormal data
Hint: Type the test data type for a value that should be rejected.
3. // Valid age is 1 to 100 // 0 and 1 are boundary test data
Hint: Type the test data type for values at the edge of the range, one rejected and one accepted.
4. INPUT Age IF Age >= 1 AND Age <= 100 THEN OUTPUT "Accepted"
Hint: Type the logical operator so test data must meet both limits to be accepted.
5. DECLARE TestAge : INTEGER INPUT TestAge OUTPUT TestAge
Hint: Type the command that lets the tester enter a test data value.

Spot the Error

Question 1
A // Range check 1 to 100
B // Normal test data
C TestData ← 150 // accepted
Line C — 150 is outside the range 1 to 100, so it is abnormal data and would be rejected. Normal test data must be inside the range, for example 50.
Question 2
A // Range check 1 to 100
B // Abnormal test data
C TestData ← 55 // rejected
Line C — 55 is inside the range 1 to 100, so it is normal data and would be accepted. Abnormal test data must be outside the range, for example -5.
Question 3
A // Mark must be 0 to 100
B // Boundary test data
C TestData ← 100 // accepted
D TestData ← 101 // accepted
Line D — 101 is just outside the boundary of 0 to 100, so it should be rejected. The expected result for 101 is rejected, not accepted.
Question 4
A // Abnormal test data
B // Range check 1 to 10
C TestData ← 1 // accepted
D TestData ← 10 // accepted
Line A — 1 and 10 are the smallest and largest values the range accepts, so they are extreme test data. Abnormal data would be rejected, but these are accepted.
Question 5
A // 1. Choose test data first
B // 2. Run the program with it
C // 3. Compare with the input
Line C — The results of running the program are compared with the expected results, which are decided before testing. They are not compared with the input.

Student with a class code? Join your class →