← IGCSE Computer Science Paper 2

Abnormal test data

Test data of the wrong type or outside the allowed values, such as -5 or letters for an age, or an empty input. The program should reject it.

Understanding Abnormal test data in IGCSE Computer Science Paper 2

What it does: Leaving the field empty fails a presence check, so it is abnormal data and the expected outcome is rejected. The value -20 is invalid for an age, so the test case expects it to be rejected and an error message shown. -5 is outside the allowed range, so it is abnormal. 35 is normal data because it is inside the range and should be accepted.

Common mistakes: -5 is outside the allowed range 0 to 120, so it is abnormal test data, not normal. Line 3 should be 'Type: abnormal'. Letters are the wrong data type for an age, so the program should reject them. Line 3 should be 'Expected: rejected'.

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 71–82) and word search (Modules 71–92).

Take this worksheet further — free with Cloodit

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

Learning
Duo
A program accepts an age from 1 to 120. Which value is abnormal test data?
-535
Matches
Age range 0 to 120. Abnormal test data: 50. Expected result: rejected
↓
50 is inside the allowed range, so it is normal data and would be accepted. Abnormal data would be a value like -5 or 150.
Applying
Meanings
Term
Abnormal test data
Meaning
Test data of the wrong type or outside the allowed values, such as -5 or letters for an age, or an empty input. The program should reject it.
Practice
// Test plan: Age (0 to 120)
Testing
Gaps
Test data type:
Check Answer
Spots
2Test data: -5
3Type: normal

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

The 'Narwhal' badge — Unicorn Coder, 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. A program accepts an age from 1 to 120. Which value is abnormal test data?
A. -5 ✓
B. 35
-5 is outside the allowed range, so it is abnormal. 35 is normal data because it is inside the range and should be accepted.
2. A program asks for a whole-number age. Which is abnormal test data?
A. 17
B. abc ✓
Letters are the wrong data type for a number, so they are abnormal. 17 is a valid age and is normal data.
3. What should a program do with abnormal test data?
A. Reject it ✓
B. Accept it
Abnormal data is invalid. The expected outcome of testing with it is that the program rejects it, usually with an error message.
4. A name field must not be left empty. Which input is abnormal test data?
A. An empty input ✓
B. Maya
An empty input fails the presence check, so it is abnormal. Maya is a valid name and is normal data.
5. A mark must be a number from 0 to 100. Which is abnormal test data?
A. 70
B. seventy ✓
The word seventy is a string, not a number, so the program should reject it. 70 is normal data.

Match the Pairs

Age: -5 (allowed range 0 to 120) → Abnormal test data: a negative age is outside the allowed values, so the program should reject it
Age: "abc" (a whole number is needed) → Abnormal test data: letters are the wrong data type for a number, so the program should reject them
An empty input is abnormal test data, and the expected outcome is that it is rejected → Test input: (nothing typed) | Expected result: rejected
Abnormal test data is chosen so that the program should reject it, not accept it → Test input: -20 | Expected result: rejected with an error message
Age range 0 to 120. Abnormal test data: 50. Expected result: rejected → 50 is inside the allowed range, so it is normal data and would be accepted. Abnormal data would be a value like -5 or 150.
Abnormal test data: "abc" for an age. Expected result: accepted → Abnormal data should be rejected. Letters are the wrong type for an age, so the expected result should be rejected, not accepted.

Key Term

Abnormal test data
Test data of the wrong type or outside the allowed values, such as -5 or letters for an age, or an empty input. The program should reject it.

Fill in the Blanks

1. Value: -5 for Age (allowed 0 to 120) Test data type: Abnormal
Hint: Type the name of the test data type for a value that is outside the allowed values and should be rejected.
2. Test value for Age: "cat" Test data type: Abnormal Expected outcome: Rejected
Hint: Type what the program should do with abnormal data.
3. IF Age < 0 THEN OUTPUT "Rejected" ENDIF
Hint: Type the command that shows a message to the user when a negative age is entered.
4. INPUT Age IF LENGTH(Age) = 0 THEN OUTPUT "Rejected"
Hint: Type the length of an empty input.
5. IF Age < 0 OR Age > 120 THEN OUTPUT "Rejected" ENDIF
Hint: Type the logical operator that rejects an age if either test is true.

Spot the Error

Question 1
A Field: Age (range 0 to 120)
B Test data: -5
C Type: normal
D Expected: rejected
Line C — -5 is outside the allowed range 0 to 120, so it is abnormal test data, not normal. Line 3 should be 'Type: abnormal'.
Question 2
A Field: Age (whole number)
B Test data: abc
C Expected: accepted
D Type: abnormal
Line C — Letters are the wrong data type for an age, so the program should reject them. Line 3 should be 'Expected: rejected'.
Question 3
A INPUT Age
B IF Age < 0 OR Age > 120 THEN
C OUTPUT "Rejected"
D ENDWHILE
Line D — An IF statement must be closed with ENDIF, not ENDWHILE. Line 4 should be ENDIF.
Question 4
A INPUT Age
B // Reject below 0 or above 120
C IF Age < 0 AND Age > 120 THEN
D OUTPUT "Rejected"
E ENDIF
Line C — No number can be both below 0 and above 120, so AND would never reject abnormal data like -5. It should use OR.
Question 5
A INPUT Name
B IF Name <> "" THEN
C OUTPUT "Rejected"
D ENDIF
Line B — Abnormal data here is an empty input, so the condition must test for an empty string with =, not <>. Line 2 should be IF Name = "" THEN.

Student with a class code? Join your class →