Explain boundary value analysis and equivalence partitioning
Model answer
Both techniques choose a small set of test inputs that still gives good coverage.
Equivalence partitioning splits the input domain into groups (partitions) where the system should behave the same. You test one representative value from each partition instead of every value. Include invalid partitions too.
Boundary value analysis adds the edges, because bugs cluster there, often from off-by-one mistakes such as < instead of <=. For each boundary, test the value on it and just either side of it.
Example: a field accepts an age from 18 to 65.
- Partitions: below 18 (invalid), 18 to 65 (valid), above 65 (invalid). Also non-numeric and empty input.
- Boundaries: 17, 18, 19 and 64, 65, 66.
That gives about a dozen tests that cover the logic, rather than testing all values from 0 to 120. Combine both techniques: partitions find the groups, and boundaries probe the risky edges of each group.
They work best together with exploratory testing and knowledge of the real requirement.
Key points
- Equivalence partitioning: one representative per group of equal behavior
- Boundary analysis: test on and either side of each edge
- Include invalid partitions such as empty and non-numeric input
- Together they reduce test count while keeping coverage
Likely follow-ups
- How would you apply this to a date range filter?
- How do you handle combinations of several inputs?
Common mistakes
- Testing only valid values and skipping invalid partitions
- Testing the boundary value but not the values around it