Back to guides

GUIDE / manual

Boundary Value Analysis and Equivalence Partitioning Explained

Learn boundary value analysis and equivalence partitioning with examples, robust BVA rules, interview tips, and how to design sharper test cases.

By The Testing AcademyPublished July 9, 2026Updated July 9, 202621 min read

Most production bugs hide at edges: max length plus one, zero items, the last valid date, the first invalid role. Boundary value analysis and equivalence partitioning are the two black-box design techniques that turn infinite input space into a small, high-value data set.

This guide explains both techniques from first principles, shows worked examples across forms, APIs, files, and dates, covers robust boundary testing, and connects the methods to real test cases, interviews, and day to day QA work. You will leave with reusable patterns, tables, and a checklist you can apply on your next feature.

What Is Equivalence Partitioning?

Equivalence partitioning (EP), also called equivalence class partitioning, is a test design technique that divides the input domain into classes of data that the software should treat the same way. If all values in a class are expected to produce the same behavior, testing one representative value from that class is usually enough for that class.

The key idea is reduction without blindness. You reduce the number of tests by removing redundant mid-class values, while still covering each distinct behavior the system is supposed to show.

Why Partitions Matter

Imagine a coupon field that accepts a 10 percent discount code SAVE10 when the order total is between 50 and 500. You could invent 200 random order totals. Most of them would teach you nothing new. A better approach is to identify classes such as:

  • Total below the minimum (invalid for discount).
  • Total inside the valid discount range.
  • Total above the maximum (invalid for discount).
  • Empty total or missing cart state.
  • Non-numeric total if the API accepts raw strings.

Each class represents a different product rule or failure mode. One good representative per class beats twenty redundant values from the same class.

Types of Equivalence Classes

Testers usually think in three broad kinds of classes:

  1. Valid classes: values the system should accept and process correctly.
  2. Invalid classes: values the system should reject, block, or handle with a clear error.
  3. Special classes: values that may be syntactically valid but semantically special, such as zero, empty, null, already used, expired, or reserved system values.

Special classes often sit between pure valid and pure invalid. For example, a username that is valid in format but already taken is not "bad data" in the same way as a blank username. It is a distinct business outcome and deserves its own partition.

Equivalence Class Partitioning Examples

Example 1: Age Field

Requirement: Age must be an integer from 18 to 60 inclusive.

PartitionTypeRepresentativeExpected behavior
Age < 18Invalid12Rejected with age policy message
18 to 60Valid35Accepted
Age > 60Invalid72Rejected with age policy message
Non-integerInvalid18.5Rejected with format message
EmptyInvalidblankRequired field message
Non-numericInvalidabcFormat validation message

You do not need ages 19, 20, 21, 22, and 23 as separate functional cases if they all sit in the same valid class and have the same rule. You might still sample more during exploratory testing if risk is high, but EP keeps the scripted suite lean.

Example 2: Payment Method Dropdown

Requirement: User can pay with Card, UPI, or Wallet. Bank transfer is not supported.

PartitionRepresentativeExpected behavior
Supported method: CardCardPayment path continues
Supported method: UPIUPIPayment path continues
Supported method: WalletWalletPayment path continues
Unsupported method if injectableBankTransferRejected or ignored safely
No method selectedemptyValidation error

Here the valid methods are different paths, so they are different partitions even though all are "valid." Same outcome class is not the same as same code path. If Card, UPI, and Wallet call different services, each needs coverage.

Example 3: API Status Filter

Requirement: List endpoint accepts status=open|closed|all.

PartitionValueExpected behavior
Open onlyopenReturns open records
Closed onlyclosedReturns closed records
All statusesallReturns both
Unknown statuspending400 or documented error
Missing statusomit paramDefault documented behavior
Wrong case if case sensitiveOPENDocumented handling

EP forces you to ask whether case, defaults, and unknown enums are specified. Incomplete requirements become visible questions instead of silent gaps.

What Is Boundary Value Analysis?

Boundary value analysis (BVA) is a test design technique that focuses on values at the edges of partitions. The assumption is simple and repeatedly proven in real defects: programmers often make mistakes at boundaries. Off-by-one errors, wrong comparison operators, inclusive versus exclusive ranges, and length checks are classic examples.

If a rule says "maximum 10 items," bugs may appear at 9, 10, and 11 more often than at 5.

Classic Boundary Candidates

For a continuous or ordered range with minimum min and maximum max, the usual high value candidates are:

  • Just below minimum: min - 1
  • Minimum: min
  • Just above minimum: min + 1 (optional, lower priority than edges)
  • Nominal mid value: somewhere in the middle
  • Just below maximum: max - 1 (optional)
  • Maximum: max
  • Just above maximum: max + 1

In many practical suites, the strongest minimum set is:

min - 1, min, max, max + 1

Add mid-range coverage through equivalence partitioning, not through endless nearby values.

Boundary Value Analysis with an Example

Requirement: Password length must be 8 to 64 characters.

ValueLengthClassExpected result
Ab1!xxx7Invalid below minRejected
Ab1!xxxx8Valid min boundaryAccepted if other rules pass
Ab1!xxxxx9Valid near minAccepted
32 char valid password32Valid midAccepted
64 char valid password64Valid max boundaryAccepted
65 char valid password65Invalid above maxRejected

If the developer wrote length > 8 instead of length >= 8, the 8 character password fails. BVA is designed to catch exactly that class of mistake.

Boundaries Are Not Only Numbers

Boundary thinking also applies to:

  • String length and trim behavior.
  • File size and dimension limits.
  • Date and time windows.
  • Pagination page size.
  • Array or cart item counts.
  • Retry limits and rate limits.
  • Session timeout windows.
  • First and last records in sorted lists.
  • Empty, single item, and full collections.

Example: a multi-select allows 1 to 5 tags.

CountExpected
0 tagsValidation error
1 tagAccepted
5 tagsAccepted
6 tagsRejected
Duplicate tag selectionDistinct rule, separate partition

Boundary Value Analysis and Equivalence Partitioning Together

The techniques are stronger as a pair. Equivalence partitioning answers, "What groups of input matter?" Boundary value analysis answers, "Which values inside and around those groups are most likely to expose defects?"

A Practical Combined Workflow

  1. Read the rule and identify ordered dimensions: min, max, length, count, date, amount, rate.
  2. Split the domain into valid, invalid, and special partitions.
  3. For ordered partitions, generate boundary candidates.
  4. For categorical partitions, pick one representative per class and path.
  5. Write expected results for each chosen value.
  6. Trace each case to the requirement or risk.
  7. Decide which cases become scripted tests, automated checks, or exploratory probes.

This workflow fits naturally into how you write test cases. EP and BVA are design methods. Test cases are the documented output of those methods.

Combined Example: Discount Rule

Requirement:

Apply a 10 percent discount when order subtotal is from 100 to 1000 inclusive. Subtotals outside that range get no discount. Currency is INR whole rupees.

Step 1: Partitions

PartitionRange or type
Below rangesubtotal < 100
In range100 to 1000
Above rangesubtotal > 1000
Zero or empty cart0 / no items
Negative amount if possible< 0
Fractional amount if API allows100.5

Step 2: Boundaries for the ordered rule

SubtotalExpected discount
99None
10010 percent
10110 percent
55010 percent
99910 percent
100010 percent
1001None

Step 3: Turn into test cases

TC-DISC-001
Title: Verify no discount below minimum subtotal
Preconditions: Cart has items totaling 99
Steps:
  1. Open checkout.
  2. Review order summary.
Expected Result: Discount line is 0 and payable total equals 99 plus tax/shipping rules.

TC-DISC-002
Title: Verify discount at minimum boundary
Preconditions: Cart has items totaling 100
Expected Result: Discount equals 10 and payable reflects the reduced amount.

TC-DISC-003
Title: Verify discount at maximum boundary
Preconditions: Cart has items totaling 1000
Expected Result: Discount equals 100 and payable reflects the reduced amount.

TC-DISC-004
Title: Verify no discount above maximum subtotal
Preconditions: Cart has items totaling 1001
Expected Result: Discount line is 0.

You now have high signal coverage with a small set of cases. That is the point of boundary value analysis and equivalence partitioning: fewer tests, better defect detection.

Robust Boundary Value Testing

Basic BVA focuses on the immediate edges. Robust boundary value testing expands the set when risk is higher.

Robust Ideas Worth Using

  • Include values farther outside the range when invalid handling may differ by magnitude.
  • Include type boundaries: empty, null, whitespace, max integer, unicode, emoji.
  • Include state boundaries: first login, last allowed retry, expired token one second early and one second late.
  • Include multi-variable boundaries when two rules interact.

Example: transfer amount must be 1 to 100000, and daily limit is 200000.

A single transfer of 100000 may pass alone, but two transfers of 100000 may hit the daily limit. Single-field BVA is not enough. You need interaction thinking.

Robust Password Policy Example

Requirement:

Password must be 8 to 64 characters, include at least one number, and must not equal the email local part.

CaseData ideaWhy it matters
Length 7 with numberAbcdef1Min length boundary
Length 8 with numberAbcdefg1Valid min
Length 64 with number64 chars ending in 1Valid max
Length 65 with number65 charsInvalid max
Length 8 without numberAbcdefghValid length, invalid composition
Password equals email local partemail sam@x.com, password sam padded if neededSpecial business rule
Leading or trailing spacesAbcd1234Trim and storage behavior

Robust testing means you do not stop at one dimension. Length, composition, uniqueness, and normalization can each create partitions and boundaries.

How to Derive Partitions from Requirements

Requirements rarely say "create equivalence classes." You have to extract them.

Look for These Clues

  • Numbers with min, max, between, at least, up to, no more than.
  • Enums and dropdown values.
  • Required versus optional fields.
  • Roles and permissions.
  • Statuses and lifecycle states.
  • Formats: email, phone, date, currency, URL.
  • Time rules: expires after, active between, grace period.
  • Uniqueness rules: already exists, already used, one per user.
  • File constraints: type, size, dimensions, page count.

Turn Ambiguity into Questions

If a requirement says "support large file uploads," ask:

  • What is the exact max size?
  • Is the limit per file or per request?
  • Are concurrent uploads allowed?
  • Is the limit different by plan tier?
  • What error appears when the limit is exceeded?
  • Is the check client side, server side, or both?

EP and BVA are only as strong as the rules you can state. Incomplete rules become open questions, not fake precision.

Multi-Field and Dependent Boundaries

Real products combine fields. Dependent rules create new partitions.

Requirement: End date must be on or after start date. Range cannot exceed 90 days. Both dates required.

Partitions and boundaries include:

CaseStartEndExpected
Valid same day2026-07-012026-07-01Accepted
Valid 90 day span2026-01-012026-04-01Accepted if exactly 90 by rule definition
Invalid reverse order2026-07-102026-07-01Rejected
Invalid 91 day spanbased on inclusive mathRejected
Missing startemptyvalid endRequired field error
Missing endvalid startemptyRequired field error

Notice that "90 days" itself needs definition. Is it inclusive of both ends? Product ambiguity creates test ambiguity. Document the assumed rule and confirm it.

Example: Quantity and Stock

Requirement: User can order 1 to 20 units, but not more than available stock.

If stock is 7:

QuantityExpected
0Rejected
1Accepted
7Accepted
8Rejected for stock
20Rejected for stock even though global max is 20
21Rejected for max rule

The active boundary is the lower of policy max and stock. That is a dependent boundary, and it is a frequent source of production bugs.

Applying BVA and EP Beyond Forms

API Query Parameters

For GET /items?page=1&pageSize=20:

ParameterBoundaries and partitions
page0, 1, last page, last+1, non-integer
pageSize0, 1, default, max, max+1
sortsupported fields, unsupported field, empty
filterknown enum, unknown enum, encoded special chars

API tests benefit heavily from EP and BVA because inputs are explicit and automation is cheap.

File Uploads

DimensionCandidates
Size0 bytes, 1 byte, max-1, max, max+1
Typeallowed MIME, disallowed MIME, mismatched extension
Nameempty, max length, unicode, path traversal style name
Contentvalid file, truncated file, malware scan stub in safe labs

Pagination and Lists

StateWhy it is a boundary
Empty listFirst-time or filtered no-result UI
Single itemOften breaks "plural" assumptions
Exact page sizeFull page rendering
Page size + 1Second page creation
Last item on last pageDelete and empty page behavior

Writing Test Cases from BVA and EP

Design techniques fail when they stay in a notebook. Convert them into cases with clear expected results.

Template Mapping

Design outputTest case field
Partition nameTitle or type
Representative or boundary valueTest data
Why this value mattersObjective or notes
Rule under testRequirement reference
Pass criteriaExpected result
Setup neededPreconditions

Sample Case Quality Bar

Weak:

Test age field with different values.

Strong:

Title: Verify age rejects value just below minimum
Priority: High
Type: Boundary negative
Preconditions: Registration form is open
Test Data: age = 17
Steps:
  1. Enter all required valid fields.
  2. Set age to 17.
  3. Submit the form.
Expected Result: Form is not submitted. User sees an age policy validation message. No account is created.

The strong case is reviewable, automatable, and tied to a specific risk.

Boundary Value Analysis Interview Questions

These techniques appear constantly in manual testing interviews. Practice answering with structure: define, example, then boundaries.

Common Prompts and Strong Answer Patterns

Q: What is equivalence partitioning?
A: It divides inputs into classes expected to behave the same so one representative can stand for the class. Example: valid emails, invalid format emails, empty email.

Q: What is boundary value analysis?
A: It tests edges of ranges because defects cluster there. For 1 to 10, test 0, 1, 10, 11.

Q: Can you use them together?
A: Yes. EP finds classes. BVA strengthens ordered class edges. Together they optimize coverage.

Q: Give a non-numeric boundary example.
A: A comment box with max 500 characters: test 500 and 501. Or a multi-file upload with max 3 files: test 3 and 4.

Q: What if requirements do not specify limits?
A: Raise a clarification, propose provisional limits from design or API docs, and mark tests blocked or assumed until confirmed.

Interviewers care less about textbook recitation and more about whether you can invent data that finds bugs.

Choosing How Many Values to Test

Not every boundary needs five values forever. Use risk.

Risk levelSuggested depth
Low risk display fieldValid class + one invalid class
Normal form validationEP classes + min/max edges
Money, auth, safety, complianceRobust BVA + dependency cases + automation
High churn algorithmAutomated boundary table plus exploratory sessions

A release with payment changes deserves deeper robust testing than a tooltip copy update.

Common Mistakes with BVA and EP

Mistake 1: Testing Only Valid Partitions

Teams often cover happy path ranges and skip invalid edges. Many production incidents come from rejected values handled poorly: 500 errors, stack traces, silent drops, or inconsistent messages.

Mistake 2: Treating Every Mid-Range Value as Special

If 25, 26, 27, and 28 all sit in the same valid class with no distinct rule, extra cases add cost without signal. Put that energy into missing partitions instead.

Mistake 3: Forgetting Inclusive vs Exclusive Rules

"Between 1 and 10" may mean different things in product language and code. Confirm whether endpoints are inclusive. Write expected results explicitly for 1 and 10.

Mistake 4: Ignoring Output Boundaries

Boundaries exist on outputs too: reports that paginate at 100 rows, invoices that round money, dashboards that chart zero values, exports that hit row limits. Input-only thinking misses half the risk.

Mistake 5: Skipping Normalization Boundaries

Whitespace, case folding, Unicode lookalikes, leading zeros, and locale formats create hidden partitions. 01 versus 1, SAVE10 versus save10, and names with trailing spaces are classic defects.

Mistake 6: No Expected Result Precision

"Should fail" is incomplete. Fail how? Which message? Which status code? Is data saved partially? Boundary cases need exact expected behavior.

Mistake 7: Designing Once, Never Updating

When limits change from 10 to 20, boundaries must change with them. Dead boundary cases create false confidence. Link cases to the requirement so updates are findable. This is part of healthy STLC maintenance, not a one-time exercise.

BVA and EP vs Exploratory Testing

These techniques are not enemies of exploration. They complement each other.

ApproachStrengthWeakness
EP and BVAStructured coverage of known rulesCan miss unknown behaviors and usability issues
Exploratory testingDiscovers unexpected risks and product questionsHarder to repeat exactly without notes
CombinedStructure plus discoveryRequires deliberate time allocation

Use EP and BVA to build the scripted backbone. Use exploratory testing to hunt for interactions, confusing workflows, and rules nobody wrote down.

Automation Notes for Boundary Tables

Boundary tables automate well because data and expected results are explicit.

# Pseudocode style data table for password length
cases = [
  {length: 7,  valid: false},
  {length: 8,  valid: true},
  {length: 64, valid: true},
  {length: 65, valid: false},
]

In UI automation, prefer API or unit-level checks for pure validation math when possible, and keep a smaller UI sample for end to end confidence. Validation logic often lives in more than one layer. Test the layer that owns the rule, then smoke the user-visible path.

If you want practice converting rules into cases under time pressure, open a QABattle battle on the manual track and force yourself to list partitions before writing steps.

Worked End-to-End Example: Registration Form

Requirement summary:

  • Username: 5 to 20 characters, alphanumeric.
  • Password: 8 to 64 characters, at least one number.
  • Age: 18 to 60.
  • Country: one of IN, US, UK.
  • Terms: must be accepted.

Partition Map

FieldValid partitionsInvalid partitions
Usernamelength 5-20 alphanumericshort, long, symbols, empty
Passwordlength 8-64 with numbershort, long, no number, empty
Age18-60 integer<18, >60, non-integer, empty
CountryIN, US, UKunsupported country, empty
Termsacceptednot accepted

Priority Boundary Suite

TC-REG-U01 Username length 4 invalid
TC-REG-U02 Username length 5 valid
TC-REG-U03 Username length 20 valid
TC-REG-U04 Username length 21 invalid
TC-REG-P01 Password length 7 with number invalid
TC-REG-P02 Password length 8 with number valid
TC-REG-P03 Password length 64 with number valid
TC-REG-P04 Password length 8 without number invalid
TC-REG-A01 Age 17 invalid
TC-REG-A02 Age 18 valid
TC-REG-A03 Age 60 valid
TC-REG-A04 Age 61 invalid
TC-REG-C01 Country IN valid
TC-REG-C02 Country XX invalid
TC-REG-T01 Terms unchecked invalid
TC-REG-T02 All valid fields success path

This suite is still small, but it covers each major class and the dangerous edges. Add role-based or uniqueness cases if the product requires unique usernames.

Review Checklist for Design Quality

Before you finalize a suite designed with these techniques, check:

  • Every ordered rule has min and max edges covered.
  • Every categorical field has each meaningful path or option covered.
  • Invalid classes have expected error behavior, not only "fail."
  • Dependent fields have interaction cases.
  • Empty, zero, and null style states are considered.
  • Output limits and rounding rules are considered.
  • Cases are traced to requirements or risks.
  • Redundant mid-class values were removed.
  • High risk rules have robust extras.
  • Ambiguous limits are logged as questions.

For planning how this suite fits a release, pair the technique work with your broader test plan vs test strategy thinking. Strategy decides when rigorous design is mandatory. Plans decide which release features get that depth.

Final Practical Workflow

When a feature arrives, run this loop:

  1. Extract rules, ranges, enums, and states from requirements.
  2. Build equivalence partitions for each input and important output.
  3. Mark ordered partitions and list boundary candidates.
  4. Add robust extras only where risk justifies cost.
  5. Convert the table into test cases with data and expected results.
  6. Review with a developer for inclusive logic and hidden constraints.
  7. Automate stable boundary tables where they protect critical rules.
  8. Keep a short exploratory charter for interactions the table may miss.
  9. Update partitions when limits or business rules change.
  10. After production bugs, ask which partition or boundary was missing and add it.

If you remember one principle, remember this: do not test more values, test more meaningful differences. Equivalence partitioning finds those differences. Boundary value analysis aims your effort at the sharpest edges. Used together, boundary value analysis and equivalence partitioning turn vague "test the form" work into deliberate, teachable, high yield coverage.

Practice on a real form today. Pick one field with a min and max, write the partitions on paper, choose four boundary values, and write expected results before you click anything. That small habit will improve both your test design and your interview answers faster than memorizing definitions alone.

FAQ

Questions testers ask

What is boundary value analysis with an example?

Boundary value analysis tests values at the edges of valid and invalid ranges. If age must be 18 to 60, strong candidates are 17, 18, 60, and 61. Bugs often hide in comparisons like less than versus less than or equal to, so edges expose off-by-one defects faster than random mid-range data.

What is equivalence partitioning in software testing?

Equivalence partitioning splits inputs into classes that should behave the same way. You pick one representative value from each class instead of testing every possible input. For a discount code field, valid codes, expired codes, and empty input can be three partitions that reduce redundant cases.

When should you use BVA and EP together?

Use them together whenever inputs have ranges, lengths, counts, dates, or categories. Equivalence partitioning finds the classes, then boundary value analysis strengthens the edges of those classes. Together they give broad coverage without an explosion of redundant mid-range tests.

What is robust boundary value testing?

Robust boundary value testing includes values just inside and just outside the valid range, plus extreme invalid values when risk justifies them. It goes beyond the minimum two-point edge check and is useful for safety, payments, security limits, and any rule with hard min and max constraints.

Is BVA only for numeric fields?

No. Boundary thinking applies to string length, file size, list counts, date ranges, pagination pages, API rate limits, password policy length, and even timing windows. Any rule with a min, max, first, last, empty, or full state can use boundary analysis.

How do BVA and EP help in interviews?

Interviewers often give a form field with a range and ask how you design cases. Explain partitions first, then name exact boundary values, state expected results, and mention negative classes. Showing both technique names and concrete data proves you can design, not only execute, tests.