Software Testing - Equivalence Partitioning (EP)
Equivalence Partitioning (EP) is a Black-Box Testing technique used to divide input data into logical groups (called partitions or classes) so that one test case from each group is enough to represent the entire group.
The idea is that all values in the same partition behave the same way, so if one value works (or fails), the rest will behave similarly.
EP helps reduce the total number of test cases while maintaining strong test coverage.
What Is Equivalence Partitioning?
Equivalence Partitioning splits input data into valid and invalid partitions.
Testers then select one representative value from each partition to test.
This makes testing efficient, organized, and scalable.
Why Use Equivalence Partitioning?
-
Reduces number of test cases
-
Covers all possible input types
-
Simplifies test design
-
Efficient for forms, validations, and input fields
-
Works for ranges, data types, formats, and categories
Types of Equivalence Partitions
1. Valid Partition
Input values that the system should accept.
2. Invalid Partition
Input values that the system should reject.
How Equivalence Partitioning Works (Step-by-Step)
-
Identify the input field and its rules.
-
Identify all possible valid ranges or categories.
-
Identify all invalid ranges or categories.
-
Create partitions (groups) of both valid and invalid inputs.
-
Choose one value from each partition for testing.
Examples of Equivalence Partitioning
Example 1: Age Input Field
Requirement:
Age must be between 18 and 60.
Partitions:
-
Invalid Partition 1: Below 18 → (values like 1, 10, 17)
-
Valid Partition: Between 18 and 60 → (values like 25, 40, 18, 60)
-
Invalid Partition 2: Above 60 → (values like 61, 75, 100)
Test Values (one from each partition):
-
17 → Invalid
-
30 → Valid
-
65 → Invalid
Example 2: Password Length
Requirement:
Password must be 8 to 16 characters.
Partitions:
-
Invalid Partition 1: Less than 8 chars
-
Valid Partition: 8–16 chars
-
Invalid Partition 2: More than 16 chars
Test Values:
-
5 chars → Invalid
-
10 chars → Valid
-
20 chars → Invalid
Example 3: Payment Method Selection
Requirement:
User must choose one of the listed payment methods:
Credit Card, Debit Card, UPI
Partitions:
-
Valid Partition: Accepted methods
-
Invalid Partition: Any other method (e.g., PayPal, Cash, Voucher)
Test Values:
-
UPI → Valid
-
Cash → Invalid
Example 4: File Upload Format
Requirement:
System accepts only jpg, png, pdf.
Partitions:
-
Valid Partition: jpg, png, pdf
-
Invalid Partition: docx, exe, txt, etc.
Test Values:
-
png → Valid
-
exe → Invalid
When to Use Equivalence Partitioning
-
Range-based inputs
-
Field validations
-
Category-based selections
-
Dropdowns, file types, formats
-
Forms with multiple input types
Advantages of EP
-
Reduces effort by minimizing test cases
-
Ensures broad test coverage
-
Simple to apply
-
Works well with Boundary Value Analysis (BVA)
Limitations of EP
-
Does not focus on boundary defects
-
Not ideal for complex workflows
-
Might miss edge cases without BVA