Modules
Intermediate⏱ 10 min read

Boundary Value Analysis & Equivalence Partitioning

sign in to track

Equivalence Partitioning (EP) and Boundary Value Analysis (BVA) are two closely related test design techniques used to create effective test cases with fewer but more meaningful test values.

  • Equivalence Partitioning divides input data into groups where values are expected to behave similarly.

  • Boundary Value Analysis focuses on the edges of those groups, where defects are commonly found.

Using both techniques together helps testers cover normal, invalid, and edge-case conditions efficiently.

Equivalence Partitioning (EP)

Equivalence Partitioning divides possible input values into equivalence classes. Values within the same class are expected to produce similar behavior, so testing one or a few representative values can provide useful coverage.

Example

Suppose an application accepts an age between 18 and 60.

The input can be divided into three partitions:

  • Below 18 → Invalid

  • 18–60 → Valid

  • Above 60 → Invalid

Representative test values could be:

  • 15 → Invalid

  • 30 → Valid

  • 65 → Invalid

The tester does not need to test every possible age because values within the same partition are expected to behave similarly.

Another Example: Password Length

Suppose a password must contain 8–20 characters.

Partitions:

  • Less than 8 characters → Invalid

  • 8–20 characters → Valid

  • More than 20 characters → Invalid

Representative values:

  • 6 characters → Invalid

  • 12 characters → Valid

  • 25 characters → Invalid

Boundary Value Analysis (BVA)

Boundary Value Analysis focuses on the limits of input ranges.

Defects often occur at boundaries because of incorrect conditions such as < instead of <=, or > instead of >=.

For this reason, testers commonly test:

  • Just below the boundary

  • At the boundary

  • Just above the boundary

Example

Suppose an application accepts an age from 18 to 60.

Useful BVA values are:

  • 17 → Just below minimum

  • 18 → Minimum boundary

  • 19 → Just above minimum

  • 59 → Just below maximum

  • 60 → Maximum boundary

  • 61 → Just above maximum

These values provide stronger coverage around the limits than simply testing a normal value such as 30.

EP and BVA Together

EP identifies the input groups, while BVA focuses on the edges of those groups.

For example, if an age must be 18–60:

Equivalence Partitioning:

  • Below 18 → Invalid

  • 18–60 → Valid

  • Above 60 → Invalid

Boundary Value Analysis:

  • 17

  • 18

  • 19

  • 59

  • 60

  • 61

This combination provides both partition coverage and boundary coverage.

Real-World Example: Online Registration

Suppose a registration form requires a username between 5 and 15 characters.

Using EP

Create three partitions:

  • Less than 5 characters → Invalid

  • 5–15 characters → Valid

  • More than 15 characters → Invalid

Representative values:

  • abc → Invalid

  • username01 → Valid

  • verylongusername123 → Invalid

Using BVA

Test values around the boundaries:

  • 4 characters → Invalid

  • 5 characters → Valid

  • 6 characters → Valid

  • 14 characters → Valid

  • 15 characters → Valid

  • 16 characters → Invalid

Difference Between EP and BVA

Equivalence Partitioning

  • Divides input into logical groups.

  • Tests representative values from each group.

  • Reduces the number of test cases.

  • Useful when there are large ranges of possible inputs.

Boundary Value Analysis

  • Focuses on the edges of input ranges.

  • Tests values around minimum and maximum limits.

  • Helps detect boundary-related defects.

  • Especially useful for fields with length, numeric, date, or quantity restrictions.

When to Use Them

Use Equivalence Partitioning when:

  • There are large ranges of possible inputs.

  • Inputs can be divided into valid and invalid groups.

  • Testing every possible value is impractical.

Use Boundary Value Analysis when:

  • There are minimum or maximum limits.

  • Fields have length restrictions.

  • Numeric ranges are defined.

  • Date or quantity limits exist.

  • Boundary-related defects are likely.

◈Key Points

  • EP: Instead of testing 1,000 valid ages, test one — they all exercise the same code path.
  • BVA: For an age field accepting 18–65, test: 17, 18, 19, 64, 65, 66 — boundaries catch off-by-one errors.
  • Three-value BVA tests the boundary, one below, and one above each partition edge.
  • Apply to both valid and invalid partitions — invalid inputs are as important as valid ones.
  • EP + BVA together dramatically reduce test case count while maintaining defect detection power.
⚡ Expert Pro Tip

Off-by-one errors are one of the most common defects in software. BVA is the single most cost-effective technique for catching them systematically.