Do We Need Both Equivalence Partitioning And Boundary Value Analysis?

Looking at the many more question about both “Equivalence Partitioning And Boundary Value Analysis” comment we decided to clear the write article on “Is It Necessary To Do Both Equivalence Partitioning And Boundary Value Analysis?” Let ‘s see in detailed and ask queries in the comment below for any unclear or open question.

To deliver a bug free software, a tester should cover maximum possible combinations of conditions. But is not possible to completely exhaust all possible conditions.  It is not only time consuming but also, it is a waste of resources. For ex: while testing for an e-commerce site offering discount as following:

Equivalence Partitioning And Boundary Value Analysis Example

To test the system functionality to apply discount depending on the purchase amount. It is not possible to test each and every value. The applicable values are too many to test. We can only pick some of the conditions and assume the system works the same for the rest of the conditions.

If the tester doesn’t have a strategy, he/she will pick up random values and test for them. Let’s suppose the values chosen are as following:

2000Rs, 3000Rs, 4000Rs, 5000Rs, 6000Rs, 7000Rs, 8000Rs, 9000Rs, 10000Rs.

Boundary value analysis with equivalence partitioning

We can analyze from the test values that many values have been missed. For ex:

  1. To test the case when customer makes a purchase that doesn’t qualify for discount.
  2. To test for a purchase which qualifies for 50% discount etc.

It is not a good approach to the testing. The chances of missing out a defect are high, these defect may come up in during real life use of application. A strategic approach or technique should be used while dealing large number of possible input values.

To deal with such problems, we use testing techniques like Boundary Analysis testing technique and Equivalence partitioning testing technique. Let’s look into them one by one.

 

Equivalence Partitioning:

Equivalence Partitioning testing technique divides input values in different partitions in such a manner that all the values in 1 partition can be treated similar or equivalent. This means, we can test only one value from each partition and assume that rest of the values in the partition will be treated in the same manner by the application or system. So, if the test for one value from a partition passes then we can assume that system is working fine for rest of the values too and we don’t need to test for them. Similarly, if the test for 1 value from a partition fails then we can assume that system will not work for the rest of the values too and there is no need to test for the rest of them.

In the above example of e-commerce website, the valid partition would be as following:

Boundary Value Analysis ValidInvalid Partitions

We have 7 partitions to test for a discount with 6 partitions eligible for discount and 1 partition not eligible for discount (negative testing or Invalid partition). If we pick one value each from every partition, then we will have 7 values to cover all the conditions.

But which value should we pick to test from the partition? Which value is more likely to fail?  By going average logic, we will most likely pick the middle value but what if the system is not applying a discount for the minimum value.

This problem is solved by combining Boundary value analysis with equivalence partitioning

 

Boundary Value Analysis:

Boundary value testing is a technique used to test a range of values. As a part of this technique, boundary values are tested as representatives of the entire range. Boundary values include minimum and maximum values from the range and first or last values from just outside range boundary

For example for a range of 1-99, the boundary values will be 0, 1, 99 and 100.

On combining Boundary value analysis with equivalence partitioning we get the boundary value from each partition. Now considering the case of e-commerce website again

Equivalence Partitioning Valid Invalid Partitions

The new set of test values will be:

998, 999, 1998, 1999, 3998, 3999, 5998, 5999, 7998, 7999, 9998, 9999

We got 12 test values, 11 values belong to the valid partitions. Here, 998 is the first value from outside range boundary i.e. from an invalid partition not eligible for discount. We do not have last value from outside range boundary since a limit has not been specified. But it is always a good practice to include the outside boundary. In this case we can assume boundary value depending on specific criteria such as maximum billable value or the limit of the billing application or the maximum digits allowed in the billing system. Then we can add 2 more values to the set of values. One more possible scenario is to include decimal value. We can include values like 1998.9 and check that it should not qualify for a discount.

Depending on the type and aim of project and software application many different types of values can be included in the test suite.

So, as we can see from the above example, we made our testing more efficient and thorough by combining the two test techniques. We have more coverage.

 

There are some points that should be noted regarding Boundary value analysis and Equivalence Partitioning Testing Techniques:

  1. These are Black Box Testing Techniques i.e. knowledge of code or its structure is not required.
  2. These techniques are used to select limited number of values for testing when the testing conditions are too many.
  3. These testing techniques can be applied to any level of testing i.e. from component accepting to User Acceptance testing.
  4. Testing techniques are selected based on the objective or aim of the project.

 

Over to you:

We can summarize Equivalence Partitioning and Boundary Value Analysis as Black box or specification based testing techniques. In cases when there is a large number of values valid for testing, these techniques are used to pick values so that maximum coverage is provided and all the scenarios are covered. Equivalence Partitioning divides the values in partitions containing similar values so that one value represents the entire partition. Boundary Value analysis technique is the process of picking the boundary values from each partition including first or last value from outside the boundary range too.

It is important to use Equivalence Partitioning with Boundary Value Analysis because it provides more coverage to the testing. Using them together is a more efficient and intelligent way. It helps to deliver thoroughly tested and high-quality software to the customer.

 


? Subscribe Us ?


If you are not regular reader of this website then highly recommends you to Sign up for our free email newsletter!! Sign up just providing your email address below:

Enter your email address:

Check email in your inbox for confirmation to get latest updates Software Testing for free.

Happy Testing!!!

3 thoughts on “Do We Need Both Equivalence Partitioning And Boundary Value Analysis?”

  1. Yes. Good article. Combination of both BVA and EC technique will surely help the Testing team to discover and to detect all possible defect in the product.
    I would surely suggest to apply combination of both BVA and EQ in the Test Cases.

    Best regards,
    Rajesh S
    SQA Consultant / Test Manager / Senior Corporate Trainer (Testing)

    Reply
  2. Isn’t there an obvious error in this:

    If the tester doesn’t have a strategy, he/she will pick up random values and test for them. Let’s suppose the values chosen are as following:
    2000Rs, 3000Rs, 4000Rs, 5000Rs, 6000Rs, 7000Rs, 8000Rs, 9000Rs, 10000Rs.

    NOTICE: 10000Rs

    We can analyze from the test values that many values have been missed. For ex:

    To test the case when customer makes a purchase that doesn’t qualify for discount.
    To test for a purchase which qualifies for 50% discount etc.

    NOTICE: 10000Rs qualifies for a 50% discount, etc ;-)

    Reply

Leave a Comment

Share This Post