Testing Fundamentals, Reframed for Automation · Lesson 2 of 5

Boundary Values & Equivalence Partitioning as Automation Inputs

You already do this by feel — you just haven't named it yet. Two techniques turn 'what values should I test?' into a short, deliberate list. Good news: they're mostly common sense.

By Shahriyar · Updated

The idea, in one line

Group inputs the system treats the same, then test one from each group — plus the values right at the edges. The two names for these moves are equivalence partitioning and boundary value analysis.

Why the edges matter

Bugs love the edges. The most common slip is an off-by-one error — someone wrote 'less than' where they meant 'less than or equal to'. That hides right at the min and max. So for each edge, test the edge itself and the value just on either side of it.

See it work

Each value becomes one row in a parametrized test — that just means one test function fed a table of inputs, so a short list drives many checks. Change the rule, edit the table, done.

▸ try it
import pytest

# Rule under test: age must be 18..65 inclusive
def is_eligible(age):
    return 18 <= age <= 65

# One value per bucket, plus the values around each edge
@pytest.mark.parametrize("age, expected", [
    (17, False),   # just below min  -> too young
    (18, True),    # the min edge itself
    (19, True),    # just above min
    (40, True),    # plain valid value
    (65, True),    # the max edge itself
    (66, False),   # just above max  -> too old
])
def test_eligibility_boundaries(age, expected):
    assert is_eligible(age) == expected

Read it top to bottom: one small rule, and a table that pokes at every bucket and every edge around it. That table is your whole test plan, written down.

Advanced — name the classes first

The real skill isn't writing the test — it's naming the buckets and edges before you touch code. Once you've listed 'too young / valid / too old' and marked each edge, the parametrize list almost writes itself. Do the thinking on paper, and the code becomes a formality.

Grounded in Guru99's Boundary Value Analysis & Equivalence Partitioning guide (aligned with ISTQB)

All lessons in Testing Fundamentals, Reframed for Automation

  1. The Test Pyramid & Quadrants — What to Automate First
  2. Boundary Values & Equivalence Partitioning as Automation Inputs
  3. Decision Tables & State Transitions
  4. Risk-Based Testing — Deciding What NOT to Automate
  5. Shift-Left, Shift-Right & Your 1-Page Test Strategy