Curriculum

Curriculum

Test Just Below, At, and Above the Limit

Scenario

A quiz score passes at 60 or higher.

Selected choicePick a choice below
Result—

Try it yourself

Predict the result at each score, then compare the three outcomes.

Reveal the explanation
  1. 59

    Failed. One point below the first passing score.

  2. 60

    Passed. The rule includes the boundary.

  3. 61

    Passed. One point above the boundary.

If the code uses > 60, the middle test fails. The other two checks would still pass.

Download shared test cases

Your turn

Write checks at 59, 60, and 61. Change the comparison to > 60 and identify the failing check.

Common mistake Testing only values far from the cutoff.

Check your work

Only the case at 60 fails after that change.