Definition

Equivalence partitioning

What is equivalence partitioning in software testing?

Equivalence partitioning groups inputs that a rule should treat alike. A tester picks a representative from each group, including groups that should be rejected, and checks the expected outcome. The groups make it easier to see which behaviours a small set of tests actually covers.

What makes two inputs equivalent?

Start with the decision the product makes. Two values belong together when the same rule and expected behaviour apply to both. A different price, status, message or side effect can justify another group. An omitted value can have its own meaning even where an empty value is invalid.

Worked example

A delivery fee with three outcomes

A shop rejects negative basket totals, charges delivery below £40 and offers free delivery from £40. The totals −£1, £25 and £60 exercise all three outcomes. To check that the threshold falls on exactly the right penny, add £39.99 and £40.00.

Try it on your pull request

Choose a change in your repository and tell Cue April what should happen. Review the proposed checks before they run.

Try Cue April on your repository