Skip to content
Course outline

Equivalence partitioning tool

List the classes of each input; it writes the fewest cases that use every class, and one case for each invalid class.

  • Free, no sign-up
  • Runs in your browser
  • Nothing you type is sent anywhere

An input can take more values than anyone could test. Equivalence partitioning splits them into classes the system should treat the same way: test one value of a class, and you have tested them all. A quantity of 3 and a quantity of 7 travel the same path through the code; 0 and 11 each take another.

List each input with its classes, the valid ones (the system must accept them) and the invalid ones (it must refuse them), with an example value for each. The tool writes the fewest test cases that use every valid class, and one case for each invalid class.

Use the tool

An input on its own line; under it "+ class = example" for a valid class and "- class = example" for an invalid one.

2 valid cases and 6 invalid cases.

Valid cases: every valid class in as few cases as possible
CaseQuantityCoupon codeCovers
V13(empty)Quantity: 1 to 10; Coupon code: no code
V23CEDAR10Quantity: 1 to 10; Coupon code: a valid code
Invalid cases: one invalid class each, the rest valid
CaseQuantityCoupon codeCovers
I10(empty)Quantity: below 1
I211(empty)Quantity: above 10
I3two(empty)Quantity: not a number
I43EXPIRED24Coupon code: expired
I53SPRING25Coupon code: used up
I63HELLO10Coupon code: unknown

How the method works

Valid classes can share a test case: a case with 3 copies and the code CEDAR10 checks a valid quantity and a valid code at once. Using every class at least once in as few cases as possible is called each-choice coverage, and it is what the valid cases here do.

Invalid classes must not share. If one case had both 0 copies and an expired code, a refusal would not tell you which of the two caused it, or whether both are checked at all. So each invalid class gets a case of its own, and every other input in that case keeps a valid value.

  1. Write each input's name on its own line.
  2. Under it, one line per class: "+ name = example" for a valid class, "- name = example" for an invalid one; "(empty)" for an empty value.
  3. Run every case: the valid ones must work, each invalid one must be refused for its own reason.

A worked example on Cedar Books

Cedar Books takes 1 to 10 copies of a book (REQ-05) and one coupon code, which can be valid, expired, used up or unknown (REQ-03, REQ-06). The tool turns those classes into two valid cases and six invalid ones:

Valid cases
CaseQuantityCoupon codeCovers
V13(empty)Quantity: 1 to 10; Coupon code: no code
V23CEDAR10Quantity: 1 to 10; Coupon code: a valid code
Invalid cases
CaseQuantityCoupon codeCovers
I10(empty)Quantity: below 1
I211(empty)Quantity: above 10
I3two(empty)Quantity: not a number
I43EXPIRED24Coupon code: expired
I53SPRING25Coupon code: used up
I63HELLO10Coupon code: unknown

Two valid cases cover the three valid classes; each of the six invalid cases changes one input only, so the message the shop shows must match that one cause. Boundary value analysis then picks the exact edges of the quantity classes.

Learn more

Put the lessons to work on a real site

Describe a user journey in plain English. QAIA walks it in a real browser and hands back the test cases, the automation code and the evidence of every step.