In our previous post, we have understood the Black Box testing method and also seen its advantages and disadvantages. In this post, we will try to understand one of the Black Box testing method called as Equivalence Partitioning. Equivalence partitioning also known as Equivalence class Partitioning.
What is Equivalence Partitioning?
Equivalence Partitioning ( EP ) is a specification based or black box testing method. It is quite a flexible type of testing and can be applicable at any level of testing. The concept behind EP is to divide the input data in different equivalent data classes and each class can be considered same by the system.
As we know exhaustive testing is practically not possible with every possible input. EP helps to solve this problem, where we need to create the set of input of same type. In this we way we will test for only one input from each set of input, as we have created a different set of input of same type. If one input is working fine then we can assume that rest of the input from the same set will work in same manner. This way tester will not require testing for each and every input. On the other hand, if any one input from any set gives the fail result that means every input from that set will give the fail result.
The effectiveness of this technique depends upon the way you are creating the set of input. We can also create the set of output and based on that we can perform EP testing. In the same we if we want, we can create the EP for valid and invalid data.
Consider we are testing registration form for insurance website where we have one textbox for age. This field accepts age from 18 to 60. So it makes no sense to create test cases for all the valid data from 18 to 60. What we will do we will create three different test set called as classes as below.
Invalid Valid Invalid
0 to 17 18 to 60 61 to any no.
So we will write three test cases using EP method, which will assure us for better coverage with limited time and efforts.