Guides

How to test a system: ordinary, edge and failure cases

Students learn most about a system by trying to break it. These six steps work for a planner, a sorter or a program, with a worked log you can copy.

By Future Skills Singapore2 min read

Key takeaways

  • Decide what “working” means before running any test.
  • Test ordinary, edge and failure cases, in that order.
  • Every result is one of four: works as intended, gives a bad answer, can’t tell yet, not tested yet.

Six steps

  • 1. Say what the system is for, and what a good output looks like.
  • 2. List its limits: time, money, safety, who it must work for.
  • 3. Choose an ordinary case and write down what should happen.
  • 4. Choose edge cases at each limit, such as zero, the maximum, or two limits at once.
  • 5. Choose a failure case: missing, wrong or unexpected input.
  • 6. Run each case, record the result, and change one thing at a time.

Record one of four results

Ask students to choose one result for every case and to say why in words.

  • Works as intended
  • Gives a bad answer
  • Can’t tell yet
  • Not tested yet

“Can’t tell yet” is a real answer. It tells the class what to find out next.

A worked log: the Activity Planner

A pair’s planner has three rules: if it rains, choose the museum ($20, 2 hours); if the budget is at least $30 and there are 3 hours, choose a picnic and kayaking; otherwise, a park walk. The data is fictional.

  • Sunny, 3 hours, $40 → picnic and kayaking. Works as intended.
  • Rain, 1 hour, $40 → museum, which takes 2 hours. Gives a bad answer. Revision: check hours in the rain rule.
  • Rain, 3 hours, $0 → museum, which costs $20. Gives a bad answer. Revision: add a free indoor option.
  • Forecast missing → picnic and kayaking. Can’t tell yet: the planner assumed a dry day. Revision: if there is no forecast, ask the teacher.
  • Haze → not run this session. Not tested yet.

End with the human checkpoint

After testing, ask: which decision should a person make, however good the rules become? In the planner, the teacher decides on the morning of the outing.

Try one case yourself on the learning approach page.

All insights →