What is Equivalence Partition Test Design?
Equivalence partitioning also called as equivalence class partitioning. It is also called as ECP. It is a software testing design technique that divides the input test data of the software under test into different partitions. Each partition is a set of similar data elements, and one test data value from each partition represents the whole partition. A minimum of equivalent data from which test cases can be derived.
An advantage of this approach is it reduces the time required for performing testing of software for less number of test cases.
The below example best describes the equivalence class partitioning:
Assume that the application accepts an integer in the range 200 to 999.
- Valid Equivalence class partition: 200 to 999 inclusive.
- In-valid equivalence class partition: less than 200, more than 999, decimal numbers and alphabets/non-numeric characters.
Equivalence Partition test is also known as Equivalence partitioning which is an important software testing technique used by the team of testers for the partitioning of the input data, which is then used for the aim of testing the software package into a variety of classes. These different classes resemble the required requirements and customary behavior of the aggregated inputs. Therefore the tests are designed and created based on each class attribute and one element or input.
The following guidelines for equivalence partitioning:
- If the condition in range is given as input, then one valid and we have two invalid equivalences classes are defined.
- If a specific value is given as input, then one valid and two invalid equivalence classes are defined.
- If a member of a group is given as an input then one valid and one invalid equivalence class is defined.
- If Boolean number is given as an input condition then one valid and invalid equivalence class is defined.
We shall consider an example of any college admission process. Consider a college that gives the admissions to students based upon their percentage.
Consider the percentage field which will accept percentage between 50% to 90%. More and even less than range will be not be accepted and application will automatically redirect the user to error page. If the percentage entered is between 50% to 90% then equivalence partitioning method will show valid percentage.
Equivalence partitioning is also called equivalence class partitioning. In this partitioning the inputs to the software or system are divided into groups that are expected to exhibit similar behaviour, so they are likely to be proposed in the same way.
How to design test case in this testing?
Consider a mobile number which has 10 digits
Valid input digits are 10 Invalid input 9 to 11 digits Valid class: Enter 10 digit mobile number = 4406565401 Invalid class Enter mobile which has less than 10 digits = 614344210 Invalid class more than 11 digits are = 51365421012
When designing test cases for the software, we can make sure that the three valid equivalence partitions are covered and we would also test the invalid equivalence partition at least once. For example, we may choose to calculate the interest balances of -$10.00, $50.00, $260.00 and $1348.00. If we did not identify the partitions, it is possible that at least one of them could have been missed at the expense of testing another one several times. Similarly, we can apply equivalence partitioning to outputs as well. In this case, we have three interests rate: 3%, 5% and 7% plus the error. The output partitions line up exactly with the input partitions.