π― What Is Equivalence Partitioning?
Equivalence Partitioning (also called Equivalence Class Partitioning) is a black-box test design technique that helps you reduce the number of test cases without losing coverage.
The main idea:
If a group of inputs is expected to be treated the same by the system, test just one value from that group.
π§ͺ Why Use Equivalence Partitioning?
- Saves time by avoiding repetitive tests
- Ensures balanced coverage of valid and invalid inputs
- Ideal for input validation, form fields, and boundary conditions
Itβs one of the core techniques covered in the ISTQB Foundation Level syllabus and is used by both manual and automation testers.
π§© How It Works
You divide all possible inputs into partitions or classes that are:
- Valid (the system should accept)
- Invalid (the system should reject)
Then, you test one value from each class.
π Example: Age Input Field
Suppose a form accepts age between 18 and 60 (inclusive).
Letβs define the equivalence classes:
Input Type | Partition | Example Value |
---|---|---|
Valid | 18 to 60 | 30 |
Invalid | Less than 18 | 16 |
Invalid | Greater than 60 | 65 |
β You only need three tests to cover all logic:
- A valid age (
30
) - An invalid low value (
16
) - An invalid high value (
65
)
π» Real-Life Use Case
System: Online banking login
Input: 6-digit numeric PIN
Rule: Must be exactly 6 digits, only numbers
Equivalence Classes:
- β
Valid: 6-digit number β
123456
- β Invalid: Less than 6 digits β
123
- β Invalid: Letters included β
12AB56
- β Invalid: Empty input β
""
π How to Apply in Your Test Cases
- Understand the requirements β what input is expected?
- Identify equivalence classes β both valid and invalid
- Choose one value from each class
- Write a test case for each value
- (Optional) Combine with Boundary Value Analysis for edge-case precision
β Benefits of Equivalence Partitioning
- Reduces total number of test cases
- Improves testing efficiency
- Easy to apply for input fields and forms
- Helps identify gaps in requirements
π Combine With: Boundary Value Analysis (BVA)
While Equivalence Partitioning tests the middle of partitions, Boundary Value Analysis focuses on the edges (like 17, 18, 60, 61 in the age example).
π Use them together for thorough coverage.
π Sample Test Case Template
Test Case ID | Input | Expected Result | Class Type |
---|---|---|---|
TC001 | 30 | Accepted | Valid |
TC002 | 16 | Rejected β Below Minimum | Invalid |
TC003 | 65 | Rejected β Above Maximum | Invalid |
π Summary
Equivalence Partitioning helps you:
- Test smarter, not harder
- Catch input validation bugs early
- Create structured, maintainable test cases
Itβs a must-know technique for anyone preparing for ISTQB or improving their manual/automation test strategy.