Designing Test Data (Normal, Boundary, Extreme, Erroneous)

Testing is the systematic execution of a program with curated test data to uncover syntax, logic, and runtime errors before software is deployed to users.


1. The Four Categories of Cambridge Test Data

Consider a validation rule requiring a student's examination score to be an integer between 0 and 100 inclusive ($0 \le \text{Mark} \le 100$):

Test Data Category

Definition

Example Values ($0 \le \text{Mark} \le 100$)

Expected System Behavior

Normal

Data that is completely valid and lies comfortably within the expected range.

35, 68, 82

Accepted and processed normally.

Extreme

Valid data situated on the exact upper and lower boundary limits.

0 (lower limit), 100 (upper limit)

Accepted as valid boundary values.

Boundary

The pair of values on either side of each boundary limit (one valid extreme and one immediate adjacent invalid).

Lower limit: -1 (rejected) & 0 (accepted).<br>Upper limit: 100 (accepted) & 101 (rejected).

Extreme value accepted; neighboring value rejected.

Erroneous (Abnormal)

Data that falls completely outside allowable limits, has the wrong data type, or violates format rules.

-25, 180, "fifty", 3.14, empty/blank.

Rejected with a clear error prompt.


2. Why Boundary Testing is Essential

Programmers frequently introduce off-by-one errors when writing conditional operators (e.g. accidentally typing > instead of >=):

// Flawed boundary condition:
IF (Mark > 0) AND (Mark < 100) THEN ...
  • A normal test value like 50 will pass this flawed code without revealing the bug.
  • Only testing the extreme boundary values (0 and 100) reveals the error, because the flawed code erroneously rejects legitimate scores of 0% and 100%!

3. Structure of a Formal Test Plan

In Cambridge Paper 2, candidates are frequently asked to construct or complete a test plan table:

Test Case ID

Test Data Input

Test Data Type

Reason for Test

Expected Outcome

TC01

75

Normal

Typical valid percentage mark

Accepted and grade calculated

TC02

0

Extreme / Boundary

Minimum valid allowable score

Accepted

TC03

-1

Boundary / Erroneous

Immediate value below lower threshold

Rejected with error message

TC04

100

Extreme / Boundary

Maximum valid allowable score

Accepted

TC05

101

Boundary / Erroneous

Immediate value above upper threshold

Rejected with error message

TC06

"eighty"

Erroneous

Non-numeric string data type

Rejected with type error message

Independent test plan

A whole-number booking size must be from 2 to 9. Propose one normal test, both extreme tests, the two boundary pairs and an abnormal type test. Write expected acceptance/rejection for each before running anything. Compare: 5 accepts; 2 and 9 accept; 1/2 and 9/10 exercise both sides of each boundary; text such as “many” is rejected. Other normal values within the range are valid choices.

AI Socratic Tutor

All-Access
Sign in or create an account. AI Tutor is an All-Access benefit.
Sign Up

Need guidance? Ask a question or use the hint below.

AI Socratic Tutor is an All-Access Benefit

Unlock step-by-step Socratic hints, algorithm trace table walkthroughs, and error diagnostics for every Cambridge exercise.

You're chatting with an AI tutor, not a person. AI can make mistakes, so double-check its answers.

Exam-Style Check: Classify Boundary Test Data Pairs

• Multiple Choice
+25 XP
Question

An algorithm validates an exam percentage mark that must be between 0 and 100 inclusive. Which set of numbers represents a complete set of boundary test data for the upper limit?

All-Access Required

Interactive exercises for Module 2 and beyond require an active plan.