← VCE Software Development U3O1

Choosing a range of test data

A good test set uses normal data (typical values), boundary data (values at the edges of a range) and invalid data (values that should be rejected), so every path in an algorithm is checked.

Understanding Choosing a range of test data in VCE Software Development U3O1

What it does: 16 is an ordinary, expected value for a school student, so it checks the usual path through the algorithm works. This selection has three branches, so you need at least three test cases, one that triggers each branch. Normal data is a typical value inside the allowed range. 65 is a sensible score. -5 is outside the range, so it is invalid data. 50 sits right on the edge of the pass condition, so it tests whether the comparison operator is correct. A negative score is impossible for a test mark, so it checks that the algorithm rejects bad input instead of processing it.

Common mistakes: The boundary value 50 would fall through to Fail, because > excludes 50. A mark of exactly 50 should pass, so the line should be: else if mark >= 50 then. Boundary tests 13 and 18 are both accepted, so 15 lies inside the valid range and is normal data. Its expected result should be accepted, not 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 168–177) and word search (Modules 168–193).

Take this worksheet further — free with Cloodit

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

Learning
Duo
An algorithm accepts quiz scores from 0 to 100. Which value is NORMAL data?
65-5
Matches
Tests for a 1 to 100 range: 20, 45, 70
↓
All values are normal data. There are no boundary tests (1, 100) and no invalid tests (0, 101), so the edges and rejection paths are never checked.
Applying
Meanings
Term
normal, boundary and invalid data
Meaning
A good test set uses normal data (typical values), boundary data (values at the edges of a range) and invalid data (values that should be rejected), so every path in an algorithm is checked.
Practice
// Valid marks are 0 to 100
Testing
Gaps
// Boundary test: mark =
Check Answer
Spots
3 print "Invalid"
4else if mark > 50 then

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

The 'Silverback Gorilla' badge — Savannah Master, 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. An algorithm accepts quiz scores from 0 to 100. Which value is NORMAL data?
A. 65 ✓
B. -5
Normal data is a typical value inside the allowed range. 65 is a sensible score. -5 is outside the range, so it is invalid data.
2. An algorithm accepts ages from 13 to 18. Which pair is BOUNDARY data?
A. 13 and 18 ✓
B. 15 and 16
Boundary data sits right at the edges of the allowed range. 13 and 18 are the lowest and highest allowed values. 15 and 16 are normal data in the middle.
3. A program should reject a mark of 150 when marks must be 0 to 100. What type of test data is 150?
A. Normal data
B. Invalid data ✓
Invalid data is a value that should be rejected. 150 is outside the 0 to 100 range, so the algorithm should reject it.
4. A login algorithm needs a password of 8 to 12 characters. Which is the better boundary test?
A. A password with exactly 8 characters ✓
B. A password with 10 characters
Exactly 8 characters is the lowest allowed length, so it is at the edge of the range. 10 characters is typical, so it is normal data.
5. An algorithm has three branches: 'Fail', 'Pass' and 'Distinction'. Which test set is better?
A. Three test cases that all trigger 'Pass'
B. One test case that triggers each branch ✓
A good test set has at least one case per branch, so every path through the algorithm is checked. Testing 'Pass' three times leaves the other branches untested.

Match the Pairs

score <- 50 → Boundary data: a value exactly on the edge of a range, such as the pass mark in if score >= 50
score <- -5 → Invalid data: a value outside what is allowed, which the algorithm should reject
Normal data is a typical value that sits well inside the allowed range → age <- 16
One test case per branch: every path in the algorithm is run at least once → if age < 13 then / else if age < 18 then / else
Tests for a 1 to 100 range: 20, 45, 70 → All values are normal data. There are no boundary tests (1, 100) and no invalid tests (0, 101), so the edges and rejection paths are never checked.
Tests for if mark >= 50 then print Pass: 80 and 90 → Both tests only run the Pass branch. The else branch (Fail) is never tested, so one path is left unchecked.

Key Term

normal, boundary and invalid data
A good test set uses normal data (typical values), boundary data (values at the edges of a range) and invalid data (values that should be rejected), so every path in an algorithm is checked.

Fill in the Blanks

1. if mark >= 50 then print "Pass" else print "Fail" // Boundary test: mark = 50
Hint: Type the value sitting exactly on the edge of the condition.
2. if mark < 0 or mark > 100 then print "Invalid" // Test mark = -5 is invalid data
Hint: Type the kind of test data that the algorithm should reject.
3. if mark >= 50 then print "Pass" else print "Fail" // Test mark = 70 is normal data
Hint: Type the kind of test data that is a typical, expected value.
4. // Valid range: 1 to 10 // Invalid values: 0 and 11 // Boundary values: 1 and 10
Hint: Type the other edge of the valid range.
5. if age >= 18 then print "Adult" else print "Minor" // Need 2 tests: one for each branch
Hint: Type how many test cases are needed to cover every branch.

Spot the Error

Question 1
A input mark
B if mark < 0 or mark > 100 then
C print "Invalid"
D else if mark > 50 then
E print "Pass"
F else print "Fail"
Line D — The boundary value 50 would fall through to Fail, because > excludes 50. A mark of exactly 50 should pass, so the line should be: else if mark >= 50 then.
Question 2
A Normal: 15 -> rejected
B Boundary: 13 -> accepted
C Boundary: 18 -> accepted
D Invalid: -4 -> rejected
Line A — Boundary tests 13 and 18 are both accepted, so 15 lies inside the valid range and is normal data. Its expected result should be accepted, not rejected.
Question 3
A Test 1: qty 5 -> full price
B Test 2: qty 10 -> bulk discount
C Test 3: qty 0 -> invalid
D Test 4: qty 9 -> bulk discount
Line D — Test 2 shows the bulk discount starts at exactly 10. The value just below the boundary, 9, should give full price, not a bulk discount.
Question 4
A input age
B while age < 0 and age > 120 do
C print "Enter 0 to 120"
D input age
Line B — No number is both below 0 and above 120, so the loop never runs and invalid data is never rejected. The condition should use or: while age < 0 or age > 120 do.
Question 5
A Fail branch: mark 30 -> Fail
B Pass branch: mark 65 -> Pass
C Pass branch: mark 70 -> Pass
D Invalid: mark -3 -> Error
Line C — This line tests the Pass branch a second time, so the Merit branch is never tested. There should be one case per branch, so it should be: Merit branch: mark 90 -> Merit.

Student with a class code? Join your class →