A Reliable Program at the Boundaries
Practise more with these
Picked by meaning from games, worksheets, simulations, teacher tools and videos.
On this sheet
The words and questions from the game
- 1A function accepts integers from 1 through 5 inclusive. Which input is an included boundary?0 · 1 · 6 · 3
- 2For an inclusive range 1 through 5, the value 5 is accepted.False · True
- 3A rule rejects a blank input. Which test directly checks that rule?Change the monitor colour. · Submit only the middle valid value. · Submit only the highest valid integer. · Submit a blank input.
- 4Each marker corresponds left to right to inputs 0, 1, 2 and 3. Filled means accepted. Which picture matches “accept n at least 2”?
- 5The specified testing plan is: choose an input, state the expected result, run the test, then compare the actual result. Put the steps in order.
- 6A function accepts integers 1 through 5 inclusive. Which pair tests just outside both ends?−1 and 7 · 1 and 5 · 0 and 6 · 2 and 4
- 7Testing a typical middle value alone proves that both boundaries work.True · False
- 8Listen to the rule. Which input is accepted?1 · 3 · 2 · 0
- 9A form requires an integer. An entry contains letters. What result follows the specified rule?Treat the letters as the number 0 without notice. · Accept the letters as an ordinary integer. · Reject the entry and report the input error. · Assume every letter means 10.
- 10Each marker corresponds left to right to inputs 0, 1, 2 and 3. Filled means accepted. Which picture matches “accept n at most 1”?
- 11If a list has valid indices 0 through 5, index 6 is within that range.False · True
- 12A rule says “show a badge when score is at least 10.” Code uses “score greater than 10.” Which boundary input reveals the error?11 · 12 · 9 · 10
- 13The intended rule accepts all integers from 3 through 7, including both endpoints. Which condition matches it?n is below 3 AND above 7 · n is at least 2 AND at most 8 · n is greater than 3 AND less than 7 · n is at least 3 AND at most 7
- 14The program must report an error when the divisor is zero. What should happen for 10 divided by 0 under this specified rule?Return 10 as an ordinary result. · Claim division by zero equals 0. · Report the zero-divisor error. · Return 1 without any error.
- 15A test for a zero divisor and a test for an ordinary nonzero divisor can check different behavior.False · True
- 16Code should accept values at most 8 but currently accepts values below 8 only. What is the smallest correction?Change “below 8” to “below 7.” · Change “below 8” to “at most 8.” · Reject every input. · Change the condition to “at most 9.”
- 17A function must return an error for negative ages and preserve valid ages. A proposed fix changes every input to 0. What is the main problem?It changes valid inputs instead of preserving them. · It reports a specific negative-input error. · It rejects only ages greater than 120. · It necessarily keeps every valid age unchanged.
- 18Listen to the rule. Which input should produce the error message?0 · −1 · 1 · 2
- 19A passing test at one input guarantees that a function is correct for all possible inputs.False · True
- 20A function must accept 0 through 100 inclusive. It rejects 0 but correctly handles 1, 100 and 101. Which targeted repair is best supported?Accept every integer without limit. · Reject every value below 100. · Accept every negative value as well as 0. · Include 0 at the lower boundary while preserving the other cases.
- 21A file parser expects one record per nonempty line and must skip blank lines. A blank line currently causes a crash. What repair best preserves the stated behavStop parsing at the first blank and discard later records. · Delete all nonempty records. · Skip blank lines and continue parsing nonempty lines. · Treat every blank as a valid record.
- 22A price must be a nonnegative number. Which test set checks the boundary and both sides most directly?−1, 0, 1 · 5, 6, 7 · 0, 5, 10 · 10, 20, 30
- 23A repair should be tested against both the formerly failing case and relevant previously passing cases.False · True
About this worksheet
A printable worksheet made from the KiwiBee game “A Reliable Program at the Boundaries”. Open it in the free Worksheet Studio to choose the design and the sheet type, then print it or save a PDF.
Design boundary tests, trace exceptional input and repair code while preserving intended behavior.
- ms 259
- computing
- design test cases
- trace exceptional input
- choose a correction that preserves intended behaviour

Comments