Review, explain, practice

Study guide: Validate and Test Reusable Rules

Test inclusive thresholds, validate inputs and count results from a reusable rule.

Download the grade study pack

Ideas to explain in your own words

Watch your reasoning

A worked review example

Test an Algorithm at Its Boundary: Input 9 gives Keep going. Input 10 gives Goal reached because equality satisfies “at least.” Input 11 also gives Goal reached. Check an Input Before Using It: Rows: −1 → invalid; 0 → Keep going; 9 → Keep going; 10 → Goal reached; 30 → Goal reached; 31 → invalid; 2.5 → invalid. Both ends of the allowed range are included. Reuse a Rule with a Parameter: status(8, 6) evaluates 8 ≥ 6 and returns reached. status(8, 10) evaluates 8 ≥ 10 and returns continue. status(6, 6) returns reached because equality is included. Count Accepted Results: 9 is valid but below goal; 10 qualifies; 31 is invalid; 12 qualifies; −1 is invalid; 0 is below goal. Running counts: 0, 1, 1, 2, 2, 2. Final reached_count = 2.

Make a practice plan

  1. Try the supplied lesson problems without looking at the answers.
  2. Compare your method with the worked examples and explain any correction.
  3. Use the new review cases, then complete the transfer task on paper or in your own document.