Equivalence Partitioning and Boundary Value Analysis: How Testers Pick the Right Test Cases

Learn how equivalence partitioning and boundary value analysis help testers cover more ground with fewer test cases, with clear step-by-step examples.

Share on Linkedin Share on WhatsApp

Estimated reading time: 7 minutes

Article image Equivalence Partitioning and Boundary Value Analysis: How Testers Pick the Right Test Cases

Imagine a form field that accepts an age between 18 and 65. How many values would you need to test to be confident it works? You can’t try every possible number, and typing random values is not a strategy. This is exactly the problem that two classic black-box testing techniques solve: equivalence partitioning and boundary value analysis. Together, they help testers choose a small set of test cases that still catches a large share of real-world bugs. In this article, you’ll learn how each technique works, why they pair so well, and how to apply them step by step.

Why we need test design techniques

Exhaustive testing, meaning trying every possible input, is impossible for almost any real system. Even a single numeric field can accept an enormous range of values, and once you combine several fields, the number of combinations grows out of control. Test design techniques give you a systematic way to reduce that huge input space to a manageable set of cases, while keeping the cases most likely to reveal defects.

Both techniques covered here are black-box techniques: they are based on the specification (what the software should do), not on the internal code. That makes them useful for manual testers, automation engineers and developers alike.

What is equivalence partitioning?

Equivalence partitioning (also called equivalence class partitioning) divides the possible inputs into groups, or partitions, where all values are expected to be treated the same way by the system. The idea is simple: if one value from a partition works, the others in that partition should work too; if one fails, the others probably fail in the same way. So you only need one representative value per partition.

Partitions come in two flavors:

  • Valid partitions: groups of inputs the system should accept.
  • Invalid partitions: groups of inputs the system should reject or handle with an error.

Back to our age field (valid range: 18 to 65 inclusive). We can identify three partitions:

PartitionRangeTypeRepresentative value
Below the range17 or lessInvalid10
Inside the range18 to 65Valid40
Above the range66 or moreInvalid80

Instead of dozens of random values, three well-chosen tests already cover every behavior the specification describes. Depending on the field, you may also add partitions for non-numeric input, empty input or decimal numbers, as long as the requirements say how those should be handled.

What is boundary value analysis?

Experience shows that bugs love edges. A developer might write age > 18 when the rule says “18 or older”, or age < 65 when 65 should be accepted. These off-by-one mistakes sit exactly at the boundaries between partitions, and a representative value from the middle of the range will never expose them.

Boundary value analysis focuses on testing values at and around the edges of each partition. A common approach, often called two-value boundary analysis, tests each boundary value plus its closest neighbor on the other side:

  • Lower boundary: 17 (invalid) and 18 (valid)
  • Upper boundary: 65 (valid) and 66 (invalid)

A more thorough variant, three-value boundary analysis, also tests the value just inside each boundary (for example 17, 18, 19 and 64, 65, 66). It costs a few more tests but can catch some additional mistakes in how conditions are written.

Why the two techniques work best together

Equivalence partitioning tells you which groups exist; boundary value analysis tells you where the risky edges of those groups are. Used together, they produce a compact but powerful test set. For the age field, a combined set might look like this:

TestInputExpected resultTechnique
110RejectedPartition (invalid, low)
217RejectedBoundary
318AcceptedBoundary
440AcceptedPartition (valid)
565AcceptedBoundary
666RejectedBoundary
780RejectedPartition (invalid, high)

Seven tests, each with a clear purpose. If any of them fails, you know exactly which rule is broken.

A step-by-step method you can reuse

  1. Read the requirement carefully. Note every rule, limit and condition. Ambiguity here (does “up to 65” include 65?) is a bug in the specification, so ask before testing.
  2. List the input conditions. Each field or parameter may have its own partitions.
  3. Identify valid and invalid partitions for each condition.
  4. Pick one representative value from each partition.
  5. Find the boundaries between partitions and add boundary values.
  6. Write the expected result for every test before running it.
  7. Review for overlap and remove redundant cases.

Beyond numbers: other places these techniques apply

Although numeric ranges are the classic example, the same thinking works in many other situations:

  • Text length: a password that must have 8 to 64 characters has boundaries at 7, 8, 64 and 65 characters.
  • Dates: a discount valid during a specific month has boundaries on the first and last days, plus the days just outside.
  • Quantities: a shopping cart that allows 1 to 10 units of a product.
  • Lists of options: a dropdown with fixed choices can be partitioned into each valid option and an invalid, unexpected value sent directly to an API.

Common mistakes to avoid

  • Testing only valid values. Invalid partitions are where error handling lives, and error handling is often less polished.
  • Combining several invalid values in one test. If a test sends an invalid age and an invalid email at once, you can’t tell which validation caught the error. Test one invalid condition at a time.
  • Guessing boundaries. Always confirm whether limits are inclusive or exclusive.
  • Forgetting data types. Consider decimals, negative numbers or empty input when the requirements cover them.

Conclusion

Equivalence partitioning and boundary value analysis turn testing from guesswork into a repeatable method. By grouping inputs that behave the same way and paying special attention to the edges, you can design fewer tests that find more bugs, and explain clearly why each test exists. These techniques are a foundation of professional QA work and appear frequently in testing certifications and job interviews. If you’d like to build these skills further, explore the free Software Testing courses on Cursa and practice designing test cases at your own pace.

Video Courses

Free video courses

See all video courses

Blog

Related articles

Read more about Software testing