What it is
Equivalence partitioning groups inputs expected to behave similarly. Boundary testing checks where behavior changes. Risk-based selection prioritizes cases by potential harm, likelihood, and change exposure rather than treating every possible combination as equally valuable.
Why you need it
You cannot enumerate every input to a real application. A reasoned selection gives stronger confidence than many arbitrary happy-path examples.
How it works
- List rules and decision boundaries.
- Choose representative valid and invalid partitions.
- Exercise values at and near each boundary.
- Add interactions that could cause important failures and document remaining gaps.
Cases for an inclusive age interval
Rule: accept integer ages from 18 through 65.
17 → reject 18 → accept
19 → accept 64 → accept
65 → accept 66 → reject
"unknown" → reject
18.5 → reject under the integer ruleThe non-integer case is a different partition from a numeric boundary. If the business accepts dates of birth rather than age numbers, you need a different model with date and time rules.
Good practices and why
- Clarify ambiguous rules before writing assertions.
- Use risk to allocate effort, and explain what was not tested when making a release recommendation.
Common mistakes
- Choosing only average values.
- Claiming full assurance because all selected cases passed.
Try it yourself
Design cases for a username with length 3–20, permitted characters, and case-insensitive uniqueness. Identify two interactions between the rules.
What a successful result looks like
Your cases cover exact lengths, invalid characters, duplicate variants, and a stated policy for whitespace.
0 / 6000 characters · Saved on this device. Do not include passwords or private data.
Check your understanding
Answer the understanding check correctly to record exercise completion.
Related interview practice
- You have two hours to test the release. ↗
- The discount breaks exactly at the threshold. ↗
- The order reaches an impossible state. ↗
These scenarios add constraints and follow-up questions to the concepts you just learned.