ISTQB Certified Tester Foundation Level
Equivalence partitioning and coverage for ISTQB CTFL
Equivalence partitioning divides data into partitions whose members the test object is expected to process in the same way, so one test per partition is sufficient. Coverage is the percentage of identified partitions, invalid ones included, that at least one test case exercises. This is how ISTQB's CTFL v4.0 syllabus defines the technique.
How are equivalence partitions formed?
The idea behind the technique: if a test with one value from a partition detects a defect, a test with any other value from that partition should detect it too. Testing more values from the same partition adds nothing to coverage.
Any data element connected with the test object can be partitioned, not only inputs: outputs, interface parameters, configuration items, internal values and values related to time as well. A partition may be ordered or not, finite or not, and discrete or continuous. They must not overlap, and none may be empty.
A partition of valid values is a valid partition, and a partition of invalid values is an invalid partition. The syllabus accepts that teams define these words differently. Valid can mean values the test object should process, or values whose processing the specification defines. Invalid can mean values that should be ignored or rejected, or values for which the specification defines no processing.
How is equivalence partitioning coverage calculated?
The coverage items are the partitions. Full coverage needs every identified partition, invalid partitions included, exercised at least once.
Example: an exam score is a whole number. Below 0 is rejected, 0 to 49 is a fail, 50 to 100 is a pass, and above 100 is rejected. That gives four partitions. Tests with the scores 30, 45 and 70 exercise two of them, because 30 and 45 fall in the same partition. Coverage is 2 / 4 = 50%. Adding -1 and 101 brings it to 100%.
What is Each Choice coverage?
A test item with more than one parameter has more than one set of partitions, and each test case covers one partition from each set. Each Choice coverage is the simplest criterion for this case: every partition of every set must be exercised at least once. It does not consider combinations of partitions.
Example: a booking has a seat class (Economy, Business) and a meal (Standard, Vegetarian, None). The tests Economy with Standard, Business with Vegetarian, and Economy with None reach Each Choice coverage. Business with None is never tested, and that does not matter for this criterion.
Where the exam catches people
- Counting only valid partitions in the coverage calculation: invalid partitions are coverage items too.
- Counting two test values from the same partition as two covered items: a partition counts once, however many values are taken from it.
- Believing Each Choice coverage needs every combination of partitions: it needs each partition exercised once and ignores combinations.
- Believing there is one correct meaning of valid and invalid: the syllabus says the definitions may vary among teams and organizations.
- Believing partitions exist only for inputs: outputs, interface parameters, configuration items and internal or time-related values can be partitioned as well.