Testing every possible input quickly becomes impossible. Two classic black‑box techniques—Equivalence Partitioning (EP) and Boundary Value Analysis (BVA)—let you trim the test suite while keeping the same fault‑finding power. Below is a quick guide to applying them together.
What is EP
- Split input into classes – Group values that the system should treat identically. For a numeric field, the ranges “negative numbers”, “zero”, and “positive numbers” become separate partitions.
- Test one value per class – Choose a single representative from each partition; that one test stands in for the whole group. If the system behaves correctly for the representative, it is assumed to behave correctly for the rest of the class.
What is BVA
- Test the edges – Most defects cluster at the limits of a range, not in the middle.
- Min, min+1, max, max‑1 – For any bounded interval, the four values — the exact lower bound, the first value above it, the exact upper bound, and the last value below it — catch off‑by‑one and similar errors.
Worked Example
Consider an “Age” field that accepts values from 18 to 60 inclusive.
| Partition | Representative values | Reasoning |
|---|---|---|
| Invalid < 18 | 17 | Below the lower bound |
| Valid 18‑60 | 18, 30, 60 | Test the lower bound, a typical interior value, and the upper bound |
| Invalid > 60 | 61 | Above the upper bound |
Applying BVA adds the “min+1” and “max‑1” values (19 and 59) to the valid set, giving the final test set: 17, 18, 19, 30, 59, 60, 61. This small collection covers all valid and invalid partitions and the critical edges where bugs often hide.
Where It Fits
- Use during test design – EP and BVA are applied while writing test cases, before any code is executed. They help you decide what to test rather than how to automate it.
- Pairs with decision tables – When several inputs interact, build a decision table and then apply EP/BVA to each column. This yields a compact yet comprehensive matrix of test scenarios.
Do / Avoid
Do
- Document which class each test case represents, so reviewers can see the coverage rationale.
- Combine EP with BVA for tighter coverage; the representative value of a class can be a boundary when the class itself is a range.
- Apply the techniques to both valid and invalid input ranges; negative testing is just as important as positive testing.
Avoid
- Don’t test every value in a class; one well‑chosen representative is sufficient.
- Don’t skip invalid partitions; they often reveal missing validation logic.
- Don’t treat boundaries as optional edge cases; they are the primary source of off‑by‑one defects.
Takeaway: Use EP to slice the input space and BVA to probe its seams, and you’ll achieve high fault detection with a fraction of the test cases.
Top comments (0)