Grade 5 · lesson 1 of 4

Test an Algorithm at Its Boundary

Choose test cases below, at, and above a rule’s threshold.

Download the grade pack

Supplied materials

  • Paper and a pencil, or say your answers aloud.

Learn the idea

A boundary is the value where a rule changes behavior. Test cases close to that boundary can catch a mistake that an ordinary example misses. State the input, the expected output, and the rule that gives that output.

Our fictional reading-club algorithm is “If pages read is at least 10, show Goal reached; otherwise show Keep going.” At least 10 means 10 or more, so 9, 10, and 11 are useful tests. This is a paper example, not a score saved to an account.

  1. Write a table with inputs 9, 10, and 11.
  2. For each input, decide whether it is 10 or more.
  3. Record expected messages: Keep going, Goal reached, Goal reached.
  4. Compare with a mistaken rule that uses more than 10, which would treat 10 incorrectly.
Worked example

See the method in action

Input 9 gives Keep going. Input 10 gives Goal reached because equality satisfies “at least.” Input 11 also gives Goal reached.

Your turn

Check your reasoning

Your answer is temporary and is not saved to an account. Download your current answer before leaving or reloading. Written work on paper or in another app stays in your own file.

For “at least 10 pages,” what message should the algorithm show at exactly 10 pages?

Feedback appears here after you check. This is practice, not a graded school assessment.

See the answer and explanation

Goal reached

Exactly 10 satisfies “at least 10,” so the expected message is Goal reached. The incorrect rule “more than 10” would exclude 10, which is why this boundary test matters.

Take it further

Change the threshold to at least 6. Test 5, 6, and 7: expected messages are Keep going, Goal reached, Goal reached. Explain why a test of 20 alone would not reveal the difference between at least 6 and more than 6.

Nothing here is saved to an account or sent to a teacher. The answer download includes your current choice and any checked feedback.

Check the subject sources

These LifeStarter passages, scenarios and exercises are authored for this Academy with AI assistance and review. External resources keep their publishers’ terms. A grade label suggests a starting level; it does not establish alignment with your school’s complete requirements.