Equivalence testing is a type of Black box type Software testing technique. It is also known as Equivalence partitioning or Equivalence class partitioning (ECP).
This type of testing technique is used to reduce the number of test cases by dividing the total test cases into different relevant classes. Each test class represents the group of similar test scenarios on which the testing is performed selectively.
Hence the major advantage of Equivalence testing or ECP is that it reduces the time required to perform testing of any software due to reduced number of test cases.
It is practically very tedious to perform testing on each set of input data and to cover all test scenarios. This will be very time consuming and will also impact the budget of the project. To overcome this Equivalence testing method is used.
Example : Entering value for ordering Number of books
Consider an example to input Number of books of a particular Name from an online book store. The book store allows to order online only 10 books at a time.
Enter Number of Books to order :
Here are the following test conditions for this scenario:
- Numbers 1 to 10 are considered valid
- Number less than 1 that is 0 or below is considered invalid.
- Number greater than 10 entered in the field is considered invalid.
- 3 Digit Number and above it say 100 and above is invalid.
In this particular case we cannot test all the possible values because if done, then the number of test cases will be more than 100. Hence to overcome this problem, we use equivalence partitioning testing where we divide the possible values books to be entered into groups or sets where the system response to the input can be considered the same throughout the class selected.
|Class 1||0 and less than 0||Invalid|
|Class 2||1 to 10||Valid|
|Class 3||11 to 99||Invalid|
|Class 4||100 and greater than 100||Invalid|
Here all the test case probabilities are divided into 4 classes as shown. To perform Equivalence testing only one test case from each Class can be considered and the testing is performed on that test case.
If one test case from a particular Class passes then it is considered as all the test cases from that class will pass. If one test case from that class fails then all the test cases from that class may fail the test.
Equivalence testing simplifies the software testing scenarios and makes it possible to test for a varied range of input data. It simplifies the testing conditions, reduces the total time of testing and solves budget constraints required for software testing.