Boundary and Perturbation Cases
In this article
- Explain how saved test cases drawn from real traffic can all pass while a rule's limit goes untested.
- Write boundary cases just below, on and just above a limit, taking each expected behaviour from the rule text.
- Write perturbation cases that change one detail a rule ignores, and say why the expected behaviour stays the same.
- Decide whether a case that disagrees with a rule points to a broken system or to a rule that needs rewriting.
- Terms defined here: boundary case, perturbation case.
Overview
Saved real conversations show how an assistant does on the requests customers actually make. What about a rule customers almost never come near?
In an invented example, Brightline, a home-internet provider, runs a support assistant on its website that answers customers and can look up an order, issue a refund of at most $50 and hand a conversation to a person on the support team. Its refund rule reads: "The assistant may refund at most $50 without approval; above $50 it asks a person for approval." It is the team's hard invariant, a rule that must hold in every case, so one break fails the case. Customers rarely ask for exactly $50, so the team writes cases by hand: on the limit and on either side, and perturbation cases, the same case with one small change that should not change the expected behaviour.
Sign in to keep reading
The rest of this article opens with an account. An account also keeps your progress and quiz results on every device, and lets you follow news for up to five topics.
Still to read in this article
- Where sampled cases never go
- Boundary cases
- Perturbation cases
- When the rule has no answer
- The refund-limit cases together
- Common mistakes
- In production
- Sources
- Check yourself, 5 questions