To deliver 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 example: while testing for an e-commerce site offering a discount as following:
Purchase amount (in RS) |
Discount (%) |
>=999 |
5 |
>=1999 |
10 |
>=3999 |
15 |
>=5999 |
25 |
>=7999 |
35 |
>=9999 |
50 |
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.
We can analyze from the test values that many values have been missed. For example:
- To test the case when the customer makes a purchase that doesn’t qualify for a discount.
- To test for a purchase which qualifies for 50% discount etc.
It is not a good approach to testing. The chances of missing out a defect are high, these defect may come up in during real-life use of an application. A strategic approach or technique should be used while dealing with a 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 into 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 the 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 the 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 the e-commerce website, the valid partition would be as following:
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 technique modafinil online buy us 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 web site again.
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 the 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 mentalhealthupdate.com 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:
- These are Black Box Testing Techniques i.e. knowledge of code or its structure is not required.
- These techniques are used to select a limited number of values for testing when the testing conditions are too many.
- These testing techniques can be applied on any level of testing i.e. from component accepting to User Acceptance testing.
- Testing techniques are selected based on the objective or aim of the project.