Curriculum

Curriculum

Test Both Lower and Upper Capacity Limits

Scenario

A seminar room accepts group sizes from 1 up to MAX_CAPACITY = 12 seats.

Selected choicePick a choice below
Result—

Try it yourself

Select each boundary case around 0/1 and 12/13 to see what each test catches.

Reveal the explanation
  1. groupSize = 0

    false — below the lower limit.

  2. groupSize = 1

    true — the exact lower limit fits.

  3. groupSize = 12 (MAX_CAPACITY)

    true — exact upper capacity fits; catches buggy < 12.

  4. 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.

Review first
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

For a valid range of 1..12 inclusive, which four numbers test both boundaries completely?
Show the answer and reasoning

Correct answer 0, 1, 12, and 13

min-1 (0), min (1), max (12), and max+1 (13) verify both inclusive endpoints.