Curriculum

Curriculum

Pair One Accepting and One Declining Example

Scenario

Room booking requires freeSeats > 0 and permission = true. Compare two candidate test pairs.

Selected choicePick a choice below
Result—

Try it yourself

Which pair isolates the permission rule cleanly?

Reveal the explanation
  1. (2 seats, permission true) → true vs. (0 seats, permission false) → false

    Noisy pair. Both inputs changed at once, so you cannot tell which rule caused false.

  2. (2 seats, permission true) → true vs. (2 seats, permission false) → false

    Clean pair. Only permission changed, isolating the permission rule.

  3. (1 seat, permission true) → true vs. (0 seats, permission true) → false

    Clean pair. Only freeSeats changed, isolating the capacity rule.

An implementation that ignores permission still passes the noisy pair! Holding all other inputs constant catches missing conditions immediately.

Download shared test cases

Your turn

Write a clean positive/negative pair for the Library Checkout rule that isolates the 3-book limit.

Common mistake Changing both book availability and borrowed count in the same declining example.

Check your work

(available=true, borrowed=2) → true paired with (available=true, borrowed=3) → false.

Quick check

Why is changing only one field between a passing case and a failing case more informative?
Show the answer and reasoning

Correct answer It proves that specific rule actually changes the decision

Isolating one variable guarantees that forgetting that single rule will break the declining case.