# How to boost your testing efficiency with Equivalence partitioning and Boundary value analysis

To give the highest test results and quality, Zen8Labs utilizes a variety of testing techniques. Equivalence partitioning and boundary value analysis approach are two of the most popular and successful methods.

## Equivalence partitioning in testing

If you ever wonder what Equivalence partitioning (or EP) is – it’s a black box testing technique. We can use it at any test level and it is one of the first techniques used at the beginning of any project’s testing process.

The idea behind this technique is to divide the input conditions or data ranges into equivalent groups/partitions. Let’s assume that all conditions and values in the same partition will be treated the same way and produce the same results, so we only test with one value in each partition. If one value in the partition is correct, we assume that all other values in the same partition are correct as well. In contrast, if any value in the partition is incorrect, then all values in that partition are incorrect.

#### Example

Interest rates on bank savings accounts vary depending on the account balance. If the balance is between \$0 and \$2000, the interest rate is 3%; 5% if the balance is between \$2001 and \$5000; and 7% if the balance is above \$5000 respectively. In other to test the program that calculates the amount of interest, we can identify the account balance ranges of different interest rates. Based on the requirement, we can identify 3 valid partitions and 1 invalid partition:

• From \$1 to \$2000
• From \$2001 to \$5000
• Above \$5000
• Below \$0

It’s important to note that in this example, we can identify four partitions even though the requirement only specifies three – it’s because we added an invalid partition (below \$0). Therefore, identifying invalid partitions as well as valid partitions is an important task for the tester (negative test), This helps to ensure that the system also handles invalid data properly (showing error messages or instructions, etc.)

If testers do not use the equivalence partitioning approach, they can use any values as input. This subjective selection of data, however, may not cover all interest rates or will necessitate a large number of test cases.

#### Why use Equivalence Partitioning?

By using the equivalence partitioning technique, you can select any four values from the four identified partitions and assume that other values in the same partition will produce the same result. As a result, you can reduce the number of test cases to be executed to four, making it more efficient.

• The number of test cases is reduced significantly because it is only necessary to select any value in each partition to test.

• The proper equivalence partitions must be determined for this technique, and the tester’s expertise is key in this regard.
• Since errors are commonly concentrated in the boundary areas between partitions, selecting values in the middle of the partition will not find many errors. Therefore, this technique is frequently combined with the boundary value analysis technique to improve testing efficiency.

## Boundary value analysis in testing

Boundary value analysis – BVA is a testing technique that involves analyzing and testing the boundary values between data partitions. As mentioned in the previous section, the errors appear more often at partition boundaries than within partitions, so the boundary values are the area where the test finds more errors. Each partition has a minimum and maximum value, that serves as the partition’s boundary values.

The following rule can be used to select test cases for a partition:

• Minimum boundary value – 1
• Minimum boundary value
• Minimum boundary value + 1
• The normal value in the partition (nominal)
• maximum boundary value – 1
• maximum boundary value
• maximum boundary value +1

#### Example

Returning to the equivalent partitioning technique example, we can select the test cases for the Valid 1 partition (3% interest) as follows:

• Since error densities more often concentrate on boundary values, this technique helps you find errors more easily and efficiently.
• Instead of testing with all values, you