Test Both Lower and Upper Capacity Limits
Scenario
A seminar room accepts group sizes from 1 up to MAX_CAPACITY = 12 seats.
Try it yourself
Select each boundary case around 0/1 and 12/13 to see what each test catches.
| Case | Result |
|---|---|
| groupSize = 0 | Select a choice above to see what happens. |
| groupSize = 1 | Select a choice above to see what happens. |
| groupSize = 12 (MAX_CAPACITY) | Select a choice above to see what happens. |
| groupSize = 13 (MAX_CAPACITY + 1) | Select a choice above to see what happens. |
Reveal the explanation
- groupSize = 0
false — below the lower limit.
- groupSize = 1
true — the exact lower limit fits.
- groupSize = 12 (MAX_CAPACITY)
true — exact upper capacity fits; catches buggy < 12.
- groupSize = 13 (MAX_CAPACITY + 1)
false — 1 over capacity declines; catches missing upper bound check.
For every range [min, max], test min-1, min, max, and max+1. Four targeted cases lock down both ends of the rule.
Download shared test cases
Your turn
List the 4 boundary test inputs for valid workshop attendance hours in [1, 8].
Common mistake Testing only 0 and 4 while skipping 8 and 9.
Check your work
0 (invalid/false), 1 (true), 8 (true), 9 (invalid/false).
Quick check
This browser could not save your progress. Changes last until you leave the page.