Example 1 — Design boundary tests for a grader
Show the steps and the answer
Pick normal inputs from the middle of each band: 95 → A, 85 → B, 50 → C.
These check that the main rule works at all.
Add boundary inputs on both sides of each change: 90 → A, 89 → B, 80 → B, 79 → C, plus the ends 100 → A and 0 → C.
Bugs gather where the rule switches, such as > typed where ≥ was meant.
Add invalid inputs just outside the range: −1 → 'invalid' and 101 → 'invalid'.
These check that the program rejects scores that cannot happen instead of grading them.
Run all 11 tests on the code that uses score > 90: grade(90) returns 'B', so that one test fails; the other 10 pass.
Only the boundary test exposes the bug. 95 and 100 still get an A, so normal tests alone would all have passed.
Answer: 11 tests: 95 → A, 85 → B, 50 → C; 90 → A, 89 → B, 80 → B, 79 → C, 100 → A, 0 → C; −1 and 101 → invalid. With > instead of ≥, only the test for 90 fails.
Takeaway: Test both sides of every boundary. A slip like > instead of ≥ is invisible to inputs from the middle of the range.