Test levels and methods
Equivalence partitioning
Equivalence partitioning divides possible inputs into groups that the system should treat the same way. Only one representative from each group is tested.
Also known as: equivalence classes, equivalence class partitioning
The idea
Testing every value is almost never possible. But if the system is supposed to treat a whole group of inputs the same way, one value from that group is enough. If it finds no defect, the others very likely won’t either.
An example
A charger accepts battery voltages from 3.0 to 4.2 V. That gives three partitions:
| Partition | Example value | Expected |
|---|---|---|
| too low | 2.5 V | deep discharge detected, pre-charge |
| valid | 3.7 V | normal charging |
| too high | 4.5 V | charging refused, error reported |
Three test cases instead of countless voltage values.
Always together with boundaries
Defects tend to sit at the transitions between partitions. That’s why equivalence partitioning is almost always combined with boundary value analysis, which checks exactly those transitions: here 2.9 V, 3.0 V, 4.2 V and 4.3 V.