In the last topic, we have studied Functional Testing. And now, in this topic we will study about Equivalence Partitioning. We will divide the test conditions in sets or groups for testing purpose. If one condition is passed within that partition then all the other conditions will also pass or if one condition fails than the condition of that partition will also fail. It is not necessary that these conditions are always true. So, the tester should know how to do better partitions. Now, let’s see an example. If the customer purchases from Rs.1/- upto Rs.50/- then he will not get any discount. If he purchases from Rs.50/- upto Rs.200/- then he will get 5% discount. If from Rs.201/- upto Rs. 500/- then 10% discount. And if it is above Rs.500/- then 15% discount. Now we have understood that from this 4 are valid Equivalence Partitions and one is invalid. How is that? Let's see. First of all is invalid partition. Why invalid? As no customer will purchase for Rs. 0.01/-. So, will the discount be applicable in it? No. Then what is the 2nd valid partition? No discount. It is in Rs.1/- to Rs.50/-. What will come after that Rs.51/- to Rs.200/-. After that Rs.201/- to Rs.500/- and if it is above Rs.501/- then 15%. Now, there is a question. If the customer purchases 50 rupees and 50 paisa, then where will it go? Will he get a 5% discount or he won’t get any discount? No, he won’t get any discount. Because what does valid partition say. Rs.51/-. If it is Rs.50.99/-, not even then. When it will be Rs.51/- only then 5% discount. Got it ? Now you think, Why did we do the Equivalence Partition? We can not test all possible values as the number of test cases will be more than 100. Right? So, we use the Equivalence Partition, where we divide most possible values and we see over how the system behaves. The hypothesis behind it is that if one condition or one value is failing in a particular partition. So, rest of the values will fail in it. And if one is passing all the other values will pass. Where is this method mostly used? This method is mostly used where there is a lot of interaction with the numerical data such as mobile number and date of birth, where validating the field in a particular range is important. Such as mobile numbers. Now, What is the maximum length of the mobile number? It is 10. Does anyone have 9 numbers? Does anyone have 11 numbers? No. What is the valid range of a mobile number? 0-10, if it is more than 10, it is invalid and if it is less than 10 than invalid. So, what will be the range of the mobile number, only 10. In the next topic, we will see Boundary Value Analysis.
Share a personalized message with your friends.