Certopolis

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.

Written from these sources

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. A tester has identified these partitions for a driver's age in whole years: P1: under 18 (invalid) P2: 18 to 24 P3: 25 to 69 P4: 70 to 99 P5: over 99 (invalid) The test cases use the ages 16, 19, 22, 30 and 65. Based only on the partitions above, what equivalence partitioning coverage do these test cases achieve? Select ONE option.

    Right. In the game that’s Renown for your Test Analysis and Design building.

    Not that one: B is right. In the game your Test Analysis and Design building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    EP coverage is partitions exercised over partitions identified: 3 / 5 = 60%. A second value in a partition already exercised adds nothing.

    Written from istqb.org/wp-content/uploads/2024/11/ISTQB_CTFL_Syllabus_v4.0.1.pdf

  2. A tester identified five equivalence partitions for an input field: three valid and two invalid. The test cases exercise all three valid partitions and neither invalid one. The tester reports 100% EP coverage. Which of the following statements about this report is CORRECT? Select ONE option.

    Right. In the game that’s Renown for your Test Analysis and Design building.

    Not that one: C is right. In the game your Test Analysis and Design building would lose a little Renown, and this question would come back later.

  3. A tester applies equivalence partitioning to two inputs: payment method (Card, Voucher, Account) and delivery speed (Standard, Express). The test cases are: T1: Card, Standard T2: Voucher, Express T3: Account, Standard A reviewer says Each Choice coverage is not yet achieved because Card is never tested with Express. Which of the following statements about the reviewer's comment is CORRECT? Select ONE option.

    Right. In the game that’s Renown for your Test Analysis and Design building.

    Not that one: D is right. In the game your Test Analysis and Design building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Delivery: Standard (T1, T3), Express (T2). All five partitions are exercised, so Each Choice coverage is 100%. Pairing Card with Express is a combination, and Each Choice does not consider combinations.

    Written from istqb.org/wp-content/uploads/2024/11/ISTQB_CTFL_Syllabus_v4.0.1.pdf

Ask for something