← ACARA Digital Technologies Years 9–10

Choosing test data for compound conditions

Values chosen so each part of a compound condition is TRUE and FALSE in turn, including boundaries like 17, 18 and 19 for Age >= 18, so every path gets tested.

Understanding Choosing test data for compound conditions in ACARA Digital Technologies Years 9–10

What it does: This is one of the four combinations for IF Age >= 18 AND HasTicket = TRUE. Age is TRUE and HasTicket is FALSE, so the AND is FALSE. The other three combinations also need test data. Count starts at 10, so Count < 5 is FALSE straight away. The loop body is skipped, which tests the zero-times path. Boundary testing uses the value just below, on, and just above the limit. 17, 18 and 19 show exactly where the condition changes from FALSE to TRUE. The case where both parts are FALSE is the only one where OR gives FALSE. Leaving it out means that path is never tested.

Common mistakes: Age 17 makes Age >= 18 FALSE, so the whole AND is FALSE even though Paid is YES. The expected result should be FALSE. The boundary test with Age 18 expects TRUE, but > 18 makes 18 FALSE. The condition should be Age >= 18.

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 536–590) and word search (Modules 536–622).

Take this worksheet further — free with Cloodit

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

Learning
Duo
A rule says: IF Age >= 18 AND HasLicence = TRUE. Which set of Age values best tests the boundary?
5, 30 and 8017, 18 and 19
Matches
Test only Age = 25 for IF Age >= 18 AND Age <= 65
↓
One value only makes both parts TRUE. It never tests a FALSE part, so most paths are untested.
Applying
Meanings
Term
test data
Meaning
Values chosen so each part of a compound condition is TRUE and FALSE in turn, including boundaries like 17, 18 and 19 for Age >= 18, so every path gets tested.
Practice
IF Age >= 18 AND Licence = "Yes" THEN
Testing
Gaps
Test Age: , 18, 19
Check Answer
Spots
2T1: Age 18, Paid YES -> TRUE
3T2: Age 17, Paid YES -> TRUE

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

The 'Kangaroo Rat' badge — Speed Typer, 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 rule says: IF Age >= 18 AND HasLicence = TRUE. Which set of Age values best tests the boundary?
A. 17, 18 and 19 ✓
B. 5, 30 and 80
Boundary testing uses the value just below, on, and just above the limit. 17, 18 and 19 show exactly where the condition changes from FALSE to TRUE.
2. For IF Age >= 18 AND HasLicence = TRUE, how many combinations of the two parts should you test?
A. 2 (both TRUE and both FALSE)
B. 4 (TRUE/TRUE, TRUE/FALSE, FALSE/TRUE, FALSE/FALSE) ✓
Each part can be TRUE or FALSE, so two parts give 2 x 2 = 4 combinations. Testing only two would miss cases where just one part fails.
3. Which test data makes only the FIRST part of IF Age >= 18 AND HasLicence = TRUE fail?
A. Age = 17, HasLicence = TRUE ✓
B. Age = 19, HasLicence = FALSE
To test one part failing, keep the other part TRUE. Age 17 makes Age >= 18 FALSE while HasLicence = TRUE stays TRUE.
4. Which statement about testing a compound condition is correct?
A. Make each part TRUE and FALSE in turn so every path is tested ✓
B. One test where the whole condition is TRUE is enough
One passing test cannot show that the algorithm rejects wrong inputs. You need cases that make each part TRUE and FALSE.
5. Age is tested with Age >= 18. Which value is the most important boundary test?
A. 100
B. 18 ✓
18 is the exact value where >= switches from FALSE (at 17) to TRUE. A mistake like writing > instead of >= only shows up when you test 18.

Match the Pairs

Age ← 17 → A boundary test value just below the limit, so Age >= 18 is FALSE
Age ← 18 → A boundary test value exactly on the limit, so Age >= 18 is TRUE
Test all four combinations of two parts: TRUE/TRUE, TRUE/FALSE, FALSE/TRUE and FALSE/FALSE → Age ← 20, HasTicket ← FALSE
Test the loop so it runs zero times, because the condition is FALSE the first time → Count ← 10 then WHILE Count < 5
Test only Age = 25 for IF Age >= 18 AND Age <= 65 → One value only makes both parts TRUE. It never tests a FALSE part, so most paths are untested.
Test Age = 10, 15 and 30 for IF Age >= 18 → No test data is on the boundary. Values 17, 18 and 19 are missing, so an error like > 18 would not be found.

Key Term

test data
Values chosen so each part of a compound condition is TRUE and FALSE in turn, including boundaries like 17, 18 and 19 for Age >= 18, so every path gets tested.

Fill in the Blanks

1. IF Age >= 18 THEN Test Age: 17, 18, 19
Hint: Type the value just below the boundary.
2. IF Age >= 18 AND HasLicence = TRUE THEN Test: Age = 20, HasLicence = FALSE
Hint: Type the Boolean value that makes the second part false while the first part stays true.
3. IF Age < 13 OR Age > 65 THEN Test Age = 40: both parts are FALSE
Hint: Type the Boolean value both parts have when the age is 40.
4. WHILE Lives > 0 AND Time > 0 DO Test: Lives = 0, so loop runs zero times
Hint: Type the number that makes the first part false straight away.
5. IF A AND B THEN Two parts, each TRUE or FALSE, need 4 tests
Hint: Type how many TRUE/FALSE combinations two parts can make.

Spot the Error

Question 1
A Rule: Age >= 18 AND Paid = YES
B T1: Age 18, Paid YES -> TRUE
C T2: Age 17, Paid YES -> TRUE
D T3: Age 18, Paid NO -> FALSE
Line C — Age 17 makes Age >= 18 FALSE, so the whole AND is FALSE even though Paid is YES. The expected result should be FALSE.
Question 2
A IF Age > 18 THEN
B T1: Age 17 -> FALSE
C T2: Age 18 -> TRUE
D T3: Age 19 -> TRUE
Line A — The boundary test with Age 18 expects TRUE, but > 18 makes 18 FALSE. The condition should be Age >= 18.
Question 3
A WHILE N < 5 AND Go = YES DO
B N <- N + 1
C ENDWHILE
D Test N=5: runs 1 time
Line D — When N is 5, N < 5 is FALSE before the first check, so the loop body runs 0 times. The test note should say it runs 0 times.
Question 4
A Rule: Rain OR Wind
B T1: Rain=T, Wind=T -> TRUE
C T2: Rain=T, Wind=F -> FALSE
D T3: Rain=F, Wind=T -> TRUE
E T4: Rain=F, Wind=F -> FALSE
Line C — OR is TRUE when at least one part is TRUE. Rain=T makes the whole condition TRUE, so the expected result is TRUE.
Question 5
A Rule: Age >= 18
B Boundary tests: 10, 30, 50
C Expect: FALSE, TRUE, TRUE
Line B — These values are far from the boundary and never test 18 itself. Good test data uses 17, 18 and 19.

Student with a class code? Join your class →