Boundary test values

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Boundary test values

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. An algorithm checks: if age >= 18 then print "Adult". Which set of test values are boundary values?
A 5, 40, 90
B 17, 18, 19
2. For the condition score > 50, which value is exactly on the boundary?
A 50
B 51
3. For the condition temperature < 30, which value is just below the boundary?
A 29
B 31
4. Why do we test 18 when the condition is age >= 18?
A To check the algorithm takes the right path at the exact edge
B Because 18 is a lucky number for testing
5. A game gives a bonus if lives > 0. Which test values check the boundary?
A 10, 20, 30
B -1, 0, 1

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1age >= 18 with test value 18 AA value just below the boundary, which should make the condition false
2age >= 18 with test value 17 Btemp > 30 tested with 31
3Boundary test values for score > 50: just below, exactly on and just above the edge CTest with 49, 50 and 51
4A value just above the boundary checks the true path starts right after the edge DThe exact boundary value 50 is missing. Add 50 to check that > does not include the edge.
5Condition: age >= 18. Tests: 5, 10, 90 EThese values are all far from the boundary. They should include 17, 18 and 19 to test the edge.
6Condition: mark > 50. Tests: 49, 51, 52 FA value exactly on the boundary, which checks that the condition includes the edge value

Definitions

Boundary values

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
if age >= 18 then age <- __ (just below the edge)
2.
Tests for price < 20: 19, __, 21
3.
Tests for mark >= 50: 49, 50, __
4.
Tests for speed > 60: __, 60, 61
5.
if age __ 18 then Tests: 17 no, 18 yes, 19 yes

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A if age >= 18 then
B print 'Adult'
C Test 18 -> no output
D Test 17 -> no output
Question 2
A if score > 50 then
B Test values: 10, 50, 90
C Expected: fail, fail, pass
Question 3
A if temp > 10 then
B print 'Wear a jumper'
C Test 9 -> Wear a jumper
D Test 10 -> no jumper
Question 4
A Condition: age >= 13
B Just below: 12
C Exactly on: 15
D Just above: 14
Question 5
A input mark
B if mark > 50 then
C print 'Pass'
D else
E print 'Fail'
F Test 50 -> Pass

Answer Key

Boundary test values
Section A: Quick Questions
Q1
B — 17, 18, 19
Q2
A — 50
Q3
A — 29
Q4
A — To check the algorithm takes the right path at the exact edge
Q5
B — -1, 0, 1
Section B: Match the Pairs
Q1
age >= 18 with test value 18 → A value exactly on the boundary, which checks that the condition includes the edge value
Q2
age >= 18 with test value 17 → A value just below the boundary, which should make the condition false
Q3
Boundary test values for score > 50: just below, exactly on and just above the edge → Test with 49, 50 and 51
Q4
A value just above the boundary checks the true path starts right after the edge → temp > 30 tested with 31
Q5
Condition: age >= 18. Tests: 5, 10, 90 → These values are all far from the boundary. They should include 17, 18 and 19 to test the edge.
Q6
Condition: mark > 50. Tests: 49, 51, 52 → The exact boundary value 50 is missing. Add 50 to check that > does not include the edge.
Section C: Definitions
Q1
Boundary values — Test inputs at the edge of a condition. For age >= 18, test 17 (just below), 18 (exactly on) and 19 (just above) to check the algorithm picks the right path at the edge.
Section D: Fill in the Blanks
Q1
if age >= 18 then age <- 17 (just below the edge)
Q2
Tests for price < 20: 19, 20, 21
Q3
Tests for mark >= 50: 49, 50, 51
Q4
Tests for speed > 60: 59, 60, 61
Q5
if age >= 18 then Tests: 17 no, 18 yes, 19 yes
Section E: Spot the Error
Q1
C — 18 is exactly on the boundary. Because the condition uses >=, 18 is included and prints 'Adult'. The line should be: Test 18 -> Adult.
Q2
B — Boundary tests need values just below, exactly on and just above the edge. 10 and 90 are far from 50. The line should be: Test values: 49, 50, 51.
Q3
A — The test results show 9 prints 'Wear a jumper' and 10 does not, so the condition must be temp < 10. Using > flips the edge and breaks the tests.
Q4
C — The value exactly on the boundary is the number in the condition, which is 13. 15 is not on the edge. The line should be: Exactly on: 13.
Q5
B — The test says 50 should pass, but with > the value 50 is not included and would print 'Fail'. The condition should be mark >= 50.