Skip to content

Boundary Value Analysis & Equivalence Partitioning: Generator + Examples

Bugs live at the edges. For an age field that accepts 18–65, 2-value BVA tests 17 18 65 66. 3-value BVA tests both neighbours of each of those: 16–19 and 64–67, eight values, not the common six. Type your own range below and copy the tests.

Try
Values

Each boundary value and both of its neighbours, invalid side included. ISTQB CTFL 4.0

8values to test for Age 18–65 · 3-value BVA
Not to scale: each window zooms in on an edge, one tick per step (1). Dashed lines are the borders between partitions. Filled dots are the values to test.
Too small≤ 17EP pick: 6
Valid18 – 65EP pick: 42
Too big≥ 66EP pick: 77
Boundary values for Age
ValueCaseExpected
16min − 2reject
17min − 1reject
18minaccept
19min + 1accept
64max − 1accept
65maxaccept
66max + 1reject
67max + 2reject
boundaries.spec.tsts
import { test, expect } from "@playwright/test"; const cases = [  { age: 16, ok: false }, // min − 2  { age: 17, ok: false }, // min − 1  { age: 18, ok: true }, // min  { age: 19, ok: true }, // min + 1  { age: 64, ok: true }, // max − 1  { age: 65, ok: true }, // max  { age: 66, ok: false }, // max + 1  { age: 67, ok: false }, // max + 2]; for (const { age, ok } of cases) {  test(`age = ${age} is ${ok ? "accepted" : "rejected"}`, async ({ page }) => {    await page.goto("/form"); // your page    await page.getByLabel("Age").fill(String(age));    await page.getByRole("button", { name: "Submit" }).click();    const error = page.getByRole("alert"); // your validation message    if (ok) await expect(error).toBeHidden();    else await expect(error).toBeVisible();  });}

Several fields at once, saved presets or one CSV for the whole form? The Boundary Value tool has the same variants, field by field.

  • 2-value BVA4values for one range: 17 · 18 · 65 · 66
  • 3-value BVA8ISTQB counts 17 and 66 as boundaries too
  • Robust BVA7Jorgensen: ±1 around each edge + a nominal
  • Per test1invalid value at a time, or errors hide each other

Equivalence partitioning and BVA in one minute

Two techniques that work as a pair. EP decides which groups of inputs exist; BVA tests where those groups meet.

Equivalence partitioning (EP) splits an input into partitions the system should treat the same way. If 30 is accepted, 40 should be too, so one value per partition is enough. You need both kinds: valid partitions, where input is accepted, and invalid ones, where it must be rejected.

Boundary value analysis (BVA) builds on EP. It tests the minimum and maximum of each ordered partition, because that is where developers write < instead of <=. Those slips stay invisible in the middle of a range.

For age 18–65, EP gives five tests, one per row of the table. BVA then pins down the two borders: 17|18 and 65|66.

Equivalence partitions for age 18–65
PartitionValuesEP pick
Too young (invalid)≤ 176
Allowed (valid)18 – 6542
Too old (invalid)≥ 6677
Not a whole number (invalid)17.5, 18.5 …17.5
Not a number / empty (invalid)"abc", """abc"

2-value vs 3-value BVA: why it's 8 values, not 6

The ISTQB Foundation syllabus defines both. The common six-value set comes from counting only the edges of the valid range; ISTQB counts the edges of every partition.

Boundary values are the minimum and maximum of every ordered partition, the invalid ones too. For 18–65 that is 17 (max of “too young”), 18, 65 and 66 (min of “too old”).

2-value BVA: each boundary value and its closest neighbour in the adjacent partition. The neighbours are boundary values themselves, so the set is just 17 18 65 66.

3-value BVA: each boundary value and both its neighbours, whichever partition they belong to. 17’s neighbours are 16 and 18; 66’s are 65 and 67. That gives 16 17 18 19 64 65 66 67.

“It is a common misconception that 2-value BVA requires twice as many coverage items as borders, and 3-value BVA requires three times as many. Both are wrong.”ISTQB white paper, Hamburg and Roman

Does the extra pair matter? Run the bug hunt. A validator written as age != 17 rejects 17 and lets every younger age through. Only 16 catches it.

Spec: age >= 18. Pick a test set:

Implemented as16171819Verdict
age > 18Classic off-by-one: 18 itself is rejected.rejectrejectrejectacceptCaught
age >= 17The edge moved one step down: 17 gets in.rejectacceptacceptacceptCaught
age == 18Only exactly 18 passes. 17 and 18 still look right.rejectrejectacceptrejectCaught
age != 17Rejects only 17. Every under-17 slips through.acceptrejectacceptacceptCaught
age > 17Same as the spec for whole numbers. Not a bug, but try 17.5.rejectrejectacceptacceptNot a bug

4 of 4 bugs caught. Red cells are the values where the wrong code answers differently from the spec.

Use 2-value BVA for low-risk fields and UI suites; use 3-value where a wrong edge costs money or access: prices, eligibility, permissions, limits.

Robust and worst-case boundary testing

These terms come from Paul Jorgensen’s Software Testing: A Craftsman’s Approach, not from ISTQB. They matter once a form has more than one field.

Normal BVA varies one field at a time through min, min + 1, max − 1 and max, with the other fields at a nominal middle value. Robust BVA adds the invalid min − 1 and max + 1. Worst-case drops the one-field-at-a-time rule and combines every value of every field. Move the slider to see what that costs.

  • Normal BVA134n + 1

    min, min + 1, max − 1, max per field, the rest at nominal

  • Robust BVA196n + 1

    adds min − 1 and max + 1 per field

  • Worst-case1255ⁿ

    every combination of the 5 normal values

  • Robust worst-case3437ⁿ

    every combination of all 7 values

  • Pairwise over the 7 robust values49every pair once

    Generate it in the Pairwise tool

Find every partition first

BVA is only as good as the partitions you found. For every input, write these six down before you pick a single value.

  1. Valid range or rangesSeveral ranges when the rules split them, like discount bands.
  2. Below min and above maxEach is its own invalid partition with its own boundary values.
  3. Wrong typeText in a number field, a decimal in a whole-number field.
  4. Empty, null, missing keyAnd whitespace only. APIs treat these three differently.
  5. Format variants007, 1e3, +18, 18,5 with a comma, full-width digits.
  6. Implicit limitsDatabase column length, int32 (2,147,483,647), proxy upload limits.

Test each invalid partition on its own. A request with a bad age and a bad email stops at the first error, and the second one is never checked. Let an AI draft partitions from a requirement

Beyond numbers: strings, dates, files

BVA works on anything with an order. Find the step: the smallest change the system can tell apart. Get the step wrong and your “neighbour” isn’t one.

InputOrdered byStep2-value example
String length 3–20length1 character2, 3, 20, 21 characters
Money 50.00 and upamount0.0149.99, 50.00
Date from todayday1 dayyesterday, today
Time windowinstant1 s (or 1 ms)23:59:59, 00:00:00
File size ≤ 10 MiBbytes1 byte10,485,760 and 10,485,761 B
Enum: card, paypal, banknone (no order)—EP only: each value + one unknown
Booleannone—EP only: true, false, missing

Five worked examples

Each one runs through the generator above. Load it, switch between 2-value and 3-value, and copy the tests.

Age: whole number, 18 to 65

RuleSign-up accepts ages 18 to 65 inclusive.

3-value BVA · 8 values

  • 16min − 2
  • 17min − 1
  • 18min
  • 19min + 1
  • 64max − 1
  • 65max
  • 66max + 1
  • 67max + 2
  • Ask whether 65 is included before you write a test. “Between 18 and 65” is read both ways.
  • EP adds the non-boundary invalid classes: 17.5, "abc" and an empty field. One per test.

Boundary tests in Playwright and pytest

One value per test, so a failure reads “age 66 is rejected”, not “test 4”. Run the 2-value set through the UI and the full 3-value set against the API, where a test costs milliseconds.

age.spec.tsts
import { test, expect } from "@playwright/test"; // 2-value BVA through the UI: four browser tests.const ages = [  { age: "17", ok: false },  { age: "18", ok: true },  { age: "65", ok: true },  { age: "66", ok: false },]; for (const { age, ok } of ages) {  test(`age ${age} is ${ok ? "accepted" : "rejected"}`, async ({ page }) => {    await page.goto("/signup");    await page.getByLabel("Age").fill(age);    await page.getByRole("button", { name: "Continue" }).click();    const error = page.getByText("Age must be between 18 and 65");    if (ok) await expect(error).toBeHidden();    else await expect(error).toBeVisible();  });}

More patterns for parameterized tests in the Playwright cheat sheet. To write the results up as test cases, use the test case template.

Seven boundary mistakes

Each looks harmless. Each lets an off-by-one bug reach production.

  • Testing the boundary but not its neighbour.

    18 passes, and you never learn that 17 is accepted too. Always test both sides of every border.

  • Using the wrong step.

    Money moves in 0.01, not 1: test 49.99 and 50.00, not 49 and 50. Timestamps move in seconds, not days.

  • Putting several invalid values in one test.

    The first error hides the rest. One invalid value per test, everything else valid.

  • Taking boundaries from the UI only.

    maxlength="64" on the input can hide a server that stores 10,000 characters. Repeat the boundaries against the API.

  • Ignoring implicit boundaries.

    Empty, null, the database column length, int32 overflow, upload limits in the proxy. None of them is in the story.

  • Guessing what “between” means.

    Is 65 included? Ask, then write the answer into the requirement so the next tester doesn't guess either.

  • Combining boundaries of many fields by hand.

    Worst-case BVA grows as 5ⁿ. Past two or three fields, feed the boundary values to a pairwise generator.

When BVA is the wrong tool

  • Values with no order: enums, booleans, country codes.

    Equivalence partitioning only: one test per value plus one unknown value.

  • Tiny domains, like a month picker.

    Test all twelve values. It's cheaper than arguing about which ones to skip.

  • Free text with no length limit.

    Content classes instead: Unicode, emoji, HTML, very long input.

  • Pure functions with numeric input.

    Property-based testing (fast-check, Hypothesis) tries thousands of values. Keep BVA for the documented edges.

  • Rules that combine several conditions.

    A decision table, one test per rule.

Test design techniques on one page

Equivalence partitioning, 2-value and 3-value BVA, robust and worst-case, decision tables and pairwise, all on the same age field. Print it or pin it in the team channel.

One-page poster: equivalence partitioning, 2-value and 3-value boundary value analysis, robust and worst-case testing, decision table and pairwise, all shown on an age field that accepts 18 to 65.
Download the poster (PNG)Free to share. A link back to this page is appreciated.

Test both sides of every border.
One invalid value per test. Boundaries from the spec, checked against the API.

FAQ

What is the difference between equivalence partitioning and boundary value analysis?

Equivalence partitioning picks one representative value from each partition, a group of inputs the system should treat the same way. Boundary value analysis tests the minimum and maximum of each ordered partition, where off-by-one bugs happen. Use them together: EP finds the partitions, BVA tests where they meet.

How many test cases does boundary value analysis produce?

For one valid range with an invalid partition on each side: 4 values with 2-value BVA (min − 1, min, max, max + 1) and 8 with ISTQB 3-value BVA, because each of those four boundary values gets both neighbours. Jorgensen's robust BVA gives 7: min − 1, min, min + 1, a nominal value, max − 1, max and max + 1.

Is 3-value boundary value analysis 6 or 8 values?

By the ISTQB CTFL 4.0 definition, 8 for a range like 18–65. Boundary values are the min and max of every partition, so 17 and 66 are boundary values too, and 3-value BVA adds both of their neighbours (16 and 67). The common six-value set min − 1, min, min + 1, max − 1, max, max + 1 counts only the edges of the valid range, so it leaves those two out.

What are the boundary values for 1 to 100?

2-value BVA: 0, 1, 100, 101. 3-value BVA by the ISTQB definition: −1, 0, 1, 2, 99, 100, 101, 102. If the domain can't go below zero, drop −1 and test 0 as the smallest possible value.

What is robust boundary value testing?

Robust BVA, from Paul Jorgensen's Software Testing: A Craftsman's Approach, extends normal BVA (min, min + 1, nominal, max − 1, max) with the invalid values just outside: min − 1 and max + 1. It checks that out-of-range input is rejected, not only that in-range input is accepted. For n independent fields it needs 6n + 1 tests.

Can boundary value analysis be used for strings and dates?

Yes, whenever the domain is ordered. For strings you test the length (step: one character), for dates the day (step: one day), for files the size (step: one byte). Enums and booleans have no order, so they get equivalence partitioning only.

Is boundary value analysis black-box or white-box testing?

Black-box. The boundaries come from the requirements, not from the code. ISTQB lists BVA with equivalence partitioning, decision tables and state transition testing as black-box test techniques.