Cambridge IGCSE · Topic 7 (5-6)
IGCSE Computer Science 0478 / Topic 7 / IGCSE

Test the edges.

A program that works for one sensible value might still fail at the edges of what it should accept, or crash on something silly. Good testers choose data on purpose: typical values, wrong values, and the values right at the limits.

The key idea

Normal data is typical data that should be accepted. Abnormal (erroneous) data should be rejected: out of range or the wrong type. Extreme data is the largest or smallest acceptable value. Boundary data is the largest or smallest acceptable value and the corresponding smallest or largest rejected value, testing both sides of each limit. Each test has an expected result.

Age must be a whole number from 11 to 18 inclusive accepted 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Normal: 14 (any typical accepted value) Extreme: 11 and 18 (the smallest and largest accepted) Boundary: 10 and 11, 18 and 19 (each edge, both sides) abnormal
Fig. 1: for ages 11 to 18, the four kinds of test data sit in different places on the number line
Section 01

Four kinds of test data.

In the lab's test data mode, pick values for each category and run the validation routine. Check that every value is accepted or rejected exactly as you predicted.

TypeMeaningAge 11 to 18 (whole numbers)Expected result
NormalTypical data the program should accept14, 16Accepted
AbnormalData that should be rejected: out of range or wrong type25, -3, "fifteen"Rejected
ExtremeThe largest and smallest acceptable values11, 18Accepted
BoundaryThe largest/smallest acceptable value and the corresponding smallest/largest rejected value11 and 10; 18 and 1911, 18 accepted; 10, 19 rejected
Examiner trap

Extreme data is always accepted: it is the very edge of what is allowed. Boundary data comes in pairs, one accepted and one rejected, at each limit.

Section 02

Choosing test data for a scenario.

In the exam you are given a rule and asked to suggest test data of a stated type, with a reason. Read the limits carefully: is each end included or not?

Worked example A percentage
A program accepts whole-number percentages from 0 to 100 inclusive. Give one example of each type of test data.
  1. Normal: a typical value such as 65 (accepted).
  2. Abnormal: a value outside the range or of the wrong type, such as 150 or "sixty" (rejected).
  3. Extreme: the smallest or largest accepted value, 0 or 100 (accepted).
  4. Boundary: at the top, 100 (accepted) and 101 (rejected); at the bottom, 0 (accepted) and -1 (rejected).
Answer: Normal 65; abnormal 150; extreme 0 or 100; boundary 100 and 101 (or 0 and -1)
Your turn
A car park accepts stays of 1 to 24 whole hours. Give the boundary test data for the upper limit, with the expected results.
Examiner trap

Read "more than 10" carefully: 10 itself is rejected, so the smallest acceptable whole number is 11. The boundary pair is then 10 (rejected) and 11 (accepted).

Stage 1 · Learn

Check what the sim just showed you

Four quick checks. Each correct answer earns XP and records this skill on your profile.

Quick check+10 XP

What is extreme test data?

Quick check+10 XP

Which type of test data should be rejected?

Quick check+10 XP

A program accepts 1 to 50. Which pair is boundary data for the upper limit?

Quick check+10 XP

In the lab, the routine accepts 11 to 18. Which value is normal test data?

Section 03

A test plan.

Testers write the expected result before running each test, then compare it with the actual result. Any difference shows an error to fix.

REPEAT
    OUTPUT "Enter your age (11 to 18)"
    INPUT Age
UNTIL Age >= 11 AND Age <= 18
OUTPUT "Age accepted"
Test dataTypeExpected result
14NormalAccepted: "Age accepted"
11Extreme (and boundary)Accepted
18Extreme (and boundary)Accepted
10BoundaryRejected: asked to enter the age again
19BoundaryRejected: asked to enter the age again
30AbnormalRejected: asked to enter the age again
Your turn
The line UNTIL Age >= 11 AND Age <= 18 is mistyped as UNTIL Age > 11 AND Age <= 18. Which test in the plan reveals the error?
Examiner trap

An expected result must be specific: "rejected, error message shown" or "accepted", not just "it works".

Stage 2 · Exam

Exam-style questions

Unlocks once the four checks above are done. Worth more XP, written to IGCSE Paper 1 standard.

Finish the four checks above to unlock the exam questions
Exam style+20 XP

A field accepts whole numbers greater than 0 and less than 10. Which is extreme test data?

Exam style+20 XP

Why is boundary data used?

Exam style+20 XP

A program accepts a number of guests from 2 to 8. Which list contains only abnormal data?

Exam style+20 XP

Which value for a range of 18 to 65 is boundary data but NOT extreme data?

Skill unlocked

Test data, mastered.

This skill is now recorded on your profile. Keep the chain going.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
Suggesting normal, abnormal, extreme and boundary test data for a scenario, with expected results.