4.2 Equivalence Partitioning

Key Takeaways

  • Equivalence partitioning (EP) divides input or output data into partitions whose members are expected to be processed the same way.
  • Test one representative value per partition; covering it covers the whole partition for that criterion.
  • Partitions are either valid (accepted) or invalid (rejected), and invalid partitions must be tested separately, not combined.
  • Partitions should be mutually exclusive and together cover the relevant domain.
  • EP coverage = partitions exercised ÷ total partitions × 100%; it slashes test volume while preserving meaningful behavioural coverage.
Last updated: June 2026

Core Idea

Equivalence partitioning (EP) divides the possible values of a parameter into partitions (also called equivalence classes) in which every member is expected to be processed in the same way by the test object. The governing assumption is that if one value in a partition reveals a defect, the others probably would too, and if one passes, the others probably would too. Therefore testing one representative value per partition is sufficient to satisfy the criterion for that partition — a massive reduction from exhaustive testing.

Partitions can be derived for inputs, outputs, internal values, time-related values, and interface parameters. They come in two kinds:

  • Valid partitions contain values the specification says should be accepted and processed.
  • Invalid partitions contain values that should be rejected, produce an error, or be handled as exceptions.

Good partitions are mutually exclusive (no value belongs to two partitions) and collectively exhaustive for the relevant domain (every value belongs to some partition). A common exam trap is forgetting the invalid partitions — the specification rarely lists them explicitly, but a complete EP analysis always includes them.

A Worked Example

A discount engine reads a customer's age and applies a child rate, a standard rate, or a senior rate:

  • 0–12 → child discount
  • 13–64 → standard rate
  • 65 and above → senior discount

The age field accepts whole numbers from 0 to 120. EP analysis yields these partitions:

PartitionKindRepresentative value
0–12 (child)Valid7
13–64 (standard)Valid30
65–120 (senior)Valid80
Below 0 (negative)Invalid-5
Above 120Invalid130
Non-numeric (e.g. "abc")Invalid"abc"

Six partitions, so six test cases give 100% EP coverage. Note that three of these are valid business partitions — EP is not only about valid/invalid acceptance, it is also about distinguishing behavioural classes within the valid range. The standard rate, child rate, and senior rate are processed differently, so each is its own partition even though all three are 'valid' inputs.

Coverage, Combining, and Common Traps

EP coverage is the proportion of partitions exercised by at least one test value:

EP coverage % = (partitions exercised
               ÷ total partitions identified) × 100

Key rules the exam tests:

  • Test invalid partitions one at a time. If you submit age = -5 and a malformed name in the same test, and it fails, you cannot tell which invalid value caused the rejection. Combine multiple valid partitions freely in one test, but isolate each invalid partition in its own test.
  • One value per partition is enough for partition coverage — adding a second value from the same partition does not raise EP coverage.
  • EP is usually paired with boundary value analysis (Section 4.3): EP chooses which partitions to cover, BVA then chooses the values at the edges of the ordered partitions.
  • Partitions are not always numeric ranges. They can be sets (payment types: card / wallet / bank transfer), roles (admin / editor / viewer), or formats (valid email vs malformed email).

EP is the workhorse of black-box design because it gives a defensible, measurable way to keep the test set small while still touching every distinct behaviour the specification describes.

Partitioning Outputs and Non-Numeric Data

A point the exam often probes: equivalence partitioning is not limited to inputs. You can partition the output domain too, then work backwards to find inputs that produce each output class. Consider a grading function that returns Fail, Pass, Merit, or Distinction. Those four results are output partitions; for full output-EP you must supply inputs that drive the function into each of the four bands. Partitioning outputs is valuable when the same input range maps to several distinct results, because it guarantees you exercise every distinct behaviour rather than just every distinct input range.

EP also handles non-ordered, non-numeric data cleanly, where boundary value analysis cannot help:

Data kindExample valid partitionsExample invalid partitions
Enumerated setcard, wallet, bank transferunsupported method
Role/categoryadmin, editor, viewerunknown role
Format/patternwell-formed emailmissing @, missing domain
Boolean/flagtrue, falsenull / not supplied

For enumerated and role data, each distinct value is typically its own partition because the system processes each differently. For formats, the valid class is 'matches the pattern' and the invalid classes are the distinct ways the pattern can be violated.

Applying EP on the exam

A reliable four-step procedure: (1) identify each parameter and its rules from the specification; (2) define the valid partitions, then the invalid partitions, for each parameter; (3) pick one representative value per partition; (4) build test cases — combining valid partitions freely but isolating each invalid one. Then state coverage as partitions exercised over partitions identified. The most common exam mistakes are forgetting the invalid partitions, treating distinct valid behaviours as a single partition, and combining two invalid values in one test.

Master those and EP questions become quick wins, especially when paired with the BVA values from the next section.

Test Your Knowledge

A password field must contain 8 through 64 characters. Which value is a representative member of the valid equivalence partition for length?

A
B
C
D
Test Your Knowledge

When applying equivalence partitioning, why should each invalid partition normally be exercised by its own separate test case?

A
B
C
D
Test Your KnowledgeMulti-Select

For a required ZIP-code field that accepts exactly five digits, which are reasonable invalid equivalence partitions?

Select all that apply

A four-digit value (too short)
A six-digit value (too long)
A value containing letters
An empty value when the field is required
A correctly formatted five-digit value