View all services
Talk to QA Advisor
Free tool · Test design

Equivalence partitioning, generated

Most inputs have far too many possible values to test, and most of those values behave identically. Describe the input and get its equivalence classes, valid and invalid, each with one representative value to test.

Runs entirely in your browser. Nothing you enter is sent to a server.

Describe an input and get every class of value it should accept or reject, with one test value for each.

Try an example

Used in test titles and exports.

Input type

A numeric field with a minimum and maximum, such as an age or a quantity.

Adds a class for decimals, which should be rejected.

Decides whether leaving it empty should be accepted or rejected.

6 partitions for Age

1 should be accepted and 5 rejected. Run one test per row, and test each invalid value on its own, so a rejection always tells you which rule fired.

Equivalence partitions for Age
IDExpectedPartitionTest valueCopy
V1Accept18 to 60 inclusiveMid-range, away from both boundaries.39
X1RejectBelow 187
X2RejectAbove 6071
X3RejectA decimal, when only whole numbers are allowed39.5
X4RejectNot a numberabc
X5RejectEmpty, on a required fieldSubmit with nothing entered.(empty)
Export as

One row per test with title, steps and expected result. Imports into TestRail, Xray, Zephyr or a spreadsheet.

How to use

How to use the Equivalence partitioning generator

  1. 1Start from an example, or name your field and choose its type: a number range, text, or a list of allowed values.
  2. 2Enter the rules from the requirement and say whether the field is required.
  3. 3Run one test per partition, and test each invalid value on its own, so a rejection always tells you which rule fired.
  4. 4Export the partitions as test cases, a Markdown table or a Gherkin feature file.

What equivalence partitioning is

Equivalence partitioning, also called equivalence class partitioning, divides the possible values of an input into groups the system should treat the same way. If an age field accepts 18 to 60, then 25, 37 and 52 all take the same path through the code. Testing one of them tells you about all of them, so one value per partition is enough.

The partitions include the invalid ones: ages below 18, ages above 60, decimals where whole numbers are required, text, and an empty field. Each invalid partition is a distinct way for input to be wrong, and each deserves its own test.

Test invalid partitions one at a time

Valid partitions from different inputs can be combined in one test, because a successful submission proves each value was accepted. Invalid partitions cannot. If a form is submitted with both an invalid age and an invalid email, and it is rejected, you have no idea which check fired. The other check might not exist at all.

This is called defect masking. The rule that follows from it is simple: every invalid partition gets a test in which it is the only thing wrong. That is why the generator lists invalid classes individually instead of combining them.

Choosing representative values

The representative of a partition should sit well inside it, not on its edge. For 18 to 60, choose something like 39, not 18. A test on the boundary belongs to boundary value analysis, and if it fails you cannot tell whether the partition or its edge is wrong. Keeping the two techniques apart keeps failures easy to diagnose.

For invalid partitions, choose a value that only the rule being tested can reject. A decimal such as 39.5 is inside the valid range, so if it is rejected, the whole-number rule did it. A text value with a digit in it, at a valid length, isolates the character rule the same way.

Partitions hide in the details

An optional field and a required field have different partitions for the empty value: valid in one, invalid in the other. A case-insensitive list of values makes "express" valid when "Express" is allowed; a case-sensitive one makes it invalid. Whitespace is another hidden partition: a value of three spaces looks filled in but should be treated as empty.

When the requirement does not say which way a detail goes, the generator still lists the partition and its note says what to decide. An unanswered question about whether input is trimmed is a requirement gap, and a requirement gap is cheaper to fix before the code is written.

QAble service

Functional testing services

QAble designs functional coverage from the requirements, partition by partition, and raises the gaps in the requirements before they become defects.

Explore the service
FAQ

Frequently asked questions

What is equivalence partitioning with an example?

It divides an input into classes that behave the same and tests one value from each. For an age field accepting 18 to 60, the classes are 18 to 60 (valid), below 18 (invalid), above 60 (invalid), decimals, text and empty (all invalid). One test per class, such as 39, 7, 71, 39.5, abc and empty.

What is the difference between equivalence partitioning and equivalence class partitioning?

None. They are two names for the same technique. Equivalence class testing is a third.

Why test invalid partitions separately?

Because combining two invalid values in one test hides which validation rejected the input. If one check is missing, the other still causes a rejection and the test passes. Testing each invalid class alone proves every rule exists.

How many test cases does equivalence partitioning need?

At least one per partition. Valid partitions from different fields can share a test, so the minimum is the number of invalid partitions plus however many tests it takes to cover every valid partition at least once.

Should I use equivalence partitioning or boundary value analysis?

Both. Partitioning picks one value from each class; boundary value analysis tests the edges between classes. They find different defects and are normally used together.

Is anything I enter sent to QAble?

No. The partitions are calculated in your browser.

Need the edge cases found for you?

QAble testers work through the inputs, payment paths and data that break products in production, before your users find them.

Talk to QA Advisor