Lesson 7 of 17 · 18 min read

Black Box Techniques I: Equivalence Partitioning & Boundary Value Analysis

Apply Equivalence Partitioning and Boundary Value Analysis with step-by-step worked examples to design fewer but stronger test cases.

Learning objectives

  • Explain black box testing and why test design techniques are needed
  • Identify valid and invalid equivalence partitions for an input
  • Derive boundary values using two-value and three-value BVA
  • Combine EP and BVA to build an efficient set of test inputs

You already know that exhaustive testing is impossible. So how does a tester choose which values to test? The answer is test design techniques. In black box testing the tester designs tests from requirements and behaviour without looking at the internal code. The two most widely used black box techniques are Equivalence Partitioning (EP) and Boundary Value Analysis (BVA). They are simple, powerful, and asked about in almost every testing interview, often as a live exercise.

Equivalence Partitioning (EP)

Equivalence partitioning divides input data into groups, called partitions or classes, where the system is expected to behave the same way for every value in the group. If one value in a partition works, the others should work too; if one fails, the others should fail in the same way. So you test one representative value per partition instead of every value.

Partitions can be valid (values the system should accept) or invalid (values the system should reject).

Worked example 1: Age field

Requirement: "A health insurance purchase form accepts applicant age from 18 to 60 years (whole numbers only)."

PartitionRangeTypeRepresentative valueExpected result
P1Less than 18Invalid10Error: age must be between 18 and 60
P218 to 60Valid35Accepted
P3Greater than 60Invalid72Error: age must be between 18 and 60
P4Non-numericInvalid"abc"Error: enter a valid number
P5Decimal numberInvalid25.5Error: whole numbers only
P6BlankInvalid(empty)Error: age is required

With six well-chosen inputs you cover the behaviour of the entire field. Notice that a good tester thinks beyond the numeric range and includes partitions for wrong data types and empty input.

Rule for invalid partitions

Test each invalid partition in a separate test case, keeping all other fields valid. If you enter an invalid age and an invalid mobile number together, one error may hide the other, and you will not know which validation actually works.

Boundary Value Analysis (BVA)

Experience shows that defects are very common at the edges of partitions. Developers often write > instead of >=, or < 60 instead of <= 60. Boundary value analysis tests values at and around these edges.

  • Two-value BVA: for each boundary, test the boundary value and its nearest neighbour in the adjacent partition. For 18–60: 17, 18, 60, 61.
  • Three-value BVA: test the boundary and both neighbours. For 18–60: 17, 18, 19, 59, 60, 61.

Worked example 1 continued: Age 18 to 60

ValuePositionExpected result
17Just below minimumRejected
18MinimumAccepted
19Just above minimumAccepted
59Just below maximumAccepted
60MaximumAccepted
61Just above maximumRejected

If the developer wrote age > 18 by mistake, the test with 18 fails and the defect is caught immediately. A random value like 35 would never reveal it.

Worked example 2: Password length

Requirement: "Password must be 8 to 16 characters long."

TechniqueValues (length in characters)
EP5 (invalid, too short), 12 (valid), 20 (invalid, too long)
BVA (three-value)7, 8, 9, 15, 16, 17

Worked Example 3: Multiple Partitions (Discount Slabs)

Requirement: "On an e-commerce app, cart value in whole rupees determines the discount: ₹1–₹499 no discount, ₹500–₹1,999 get 5% off, ₹2,000–₹50,000 get 10% off. Cart value above ₹50,000 cannot be checked out online."

PartitionRange (₹)Expected behaviourBoundary values to test
Invalid0 or lessCheckout not allowed0
Valid A1 – 499No discount1, 499
Valid B500 – 1,9995% discount500, 1,999
Valid C2,000 – 50,00010% discount2,000, 50,000
InvalidAbove 50,000Checkout blocked with message50,001

Using two-value BVA, the final test values are 0, 1, 499, 500, 1999, 2000, 50000, 50001. You can add one mid-value per valid partition (for example 250, 1,200 and 10,000) from EP. With about 11 inputs, you have strong coverage of a rule that has fifty thousand possible values.

Example: Decimal boundaries

If the cart value can include paise, the boundary between "no discount" and "5%" becomes ₹499.99 and ₹500.00. Always check the precision the requirement allows, because the "nearest neighbour" depends on it.

Steps to Apply EP and BVA Together

  1. Read the requirement and identify each input or output condition with a range or set of values.
  2. List valid partitions and invalid partitions, including wrong data types and blank input.
  3. Pick one representative value from each partition.
  4. Identify every boundary between partitions and add boundary values.
  5. Remove duplicates and write the expected result for each value.
  6. Ask the business analyst about any boundary the requirement does not define clearly.
Interview tip

A common interview question is: "A field accepts 1 to 100. What will you test?" Answer with structure: "EP gives me three partitions with values like 0 or -5, 50 and 150. BVA gives me 0, 1, 2, 99, 100 and 101. I will also test blank, alphabets, special characters and decimals as invalid partitions."

Common Mistakes to Avoid

  • Testing only valid values and forgetting invalid partitions.
  • Combining several invalid values in one test case.
  • Ignoring output partitions, such as different discount amounts or messages.
  • Assuming boundaries without checking whether limits are inclusive ("up to 60" versus "below 60").

Key takeaways

  • Black box techniques design tests from requirements, not code
  • EP groups inputs that behave the same and tests one value per group
  • Always include invalid partitions such as wrong type and blank input
  • BVA tests at and around partition edges, where defects are most common
  • For a range 18–60, three-value BVA gives 17, 18, 19, 59, 60, 61
  • Test each invalid partition separately to avoid hiding defects
✓ You're subscribed! Job alerts arrive daily at 9 AM.
Scroll to Top