Testing

April 19, 2016

What Boundary Value Analysis & Equivalence Partitioning Are All About

Testing is one of the most important phases in the life cycle of a project and test design is a vital part of the testing phase. Testing has to be planned, designed, executed and tracked to achieve quality testing. As the project grows, it may not be possible to do exhaustive testing and test each input value. Intelligent techniques are needed to select the right test cases from huge test-case pool and ensure all scenarios are covered.

The right test design techniques help in evolving the big picture of the system under test with apt number of test cases. Although in agile methodology, testing phase is said to begin right from the kick-off phase, the execution time given to the testers is always limited. So it is wise to utilize the time till the actual testing starts to design the test cases that are efficient applying the principles of some of the best test design techniques like Boundary Value Analysis and Equivalence Partitioning.

These testing techniques increase the efficiency and effectiveness of testing independent of the tester executing the test cases. The test cases are based on a strategy that can be easily modified even if there are minor changes in the requirements and can be extended to the maintenance phase of the project. With many such advantages, knowledge of these techniques becomes imperative to achieve successful testing.

Understanding Boundary Value Analysis & Equivalence Partitioning

Black Box Testing is where test cases are written to test the inputs and verify the output of the software system without the knowledge about the internal working of the software.

Both Boundary Value Analysis and Equivalence Partitioning are black box testing design techniques. Although they are two different techniques, they can be used together at all levels of testing.

Equivalence Partitioning

In this technique, the entire range of input data is divided into different partitions. All possible test cases are considered and divided into logical set of data called classes. One test value is picked from each class during test execution.

For instance, consider an application where valid input is a three-digit number. This scenario can have three different classes.

  • Valid inputs including any value from 100 to 999
  • Invalid inputs which are below 100
  • Invalid inputs which are above 999

You can select one value from each of these classes and design the test cases. It can be safely assumed that any chosen value in these classes would behave the same way.

Equivalence partitioning is most useful when fewer test cases should cover maximum requirements.

Boundary Value Analysis

It is observed that in most applications, errors occur at the boundary values. Boundary value analysis can be considered as the next part of Equivalence partitioning where test cases are selected at the borders of the equivalence classes. Boundary Value Analysis can have four main test scenarios.

  1. Minimum
  2. Just below the boundary values
  3. Maximum
  4. Just above the boundary values

If we consider the same example of an application requiring 3-digit number input, the boundary value conditions could be:

  • 100
  • 999
  • 99
  • 1000

Boundary value analysis is also considered a type of stress and negative testing.

 

Benefits of following these techniques

Testing random inputs picking test cases out of the air may not work when you need to test a huge application with exhaustive set of input data. It would not be reliable. So you need some design techniques to identify test cases that can assure quality testing.

Some of the benefits of knowing and implementing these techniques are:

1. Reducing redundant test cases

When you have huge number of input values as explained in the above instance, there is no point to test all the values from 100 to 999. It would be time taking and the efforts would rather be a waste. Constructive test design techniques like Boundary Value Analysis & Equivalence Partitioning can prove to be smart as it eliminates testing each input.

2. Achieving high test coverage

In the above instance, it needs testing virtually all the numbers to have complete test coverage. But that is rather impossible. Boundary Value Analysis & Equivalence Partitioning ensure coverage of all the test scenarios.

3. Standardizing and structuring the test cases

Sometimes test cases written by testers become so dependent on the author of the test case because it would not be a standard test case. Following a defined structure would remove this dependency. It would also increase the standard of testing as the test cases would be more effective.

4. Achieving quality testing within the agreed time frame

“Time is money” is a common cliché. In the above instance, it would probably take years to test all possible input values even if you assume the input field allows up to 5-digit input. So you need to invariably design your test cases using Boundary Value Analysis & Equivalence Partitioning to be able to complete testing and sign off the application.

5. Removes unreliability

Random testing cannot be reliable especially for critical applications. It is important to cover all the scenarios. Test cases should cover all logical scenarios if it cannot test each input value. Boundary Value Analysis and Equivalence Partitioning are reliable techniques which have been widely adopted in several successful testing suites.

Why is Boundary Value Analysis and Equivalence Partitioning a good combination?

When you test boundaries, you would have actually tested one of the equivalence partition classes. But if the output fails, only Boundary Value Analysis may not be enough to conclude that the system is faulty. The system might work well with the values between the borders. Only borders may be failing.

The vice versa also is true. If you only test one of the values in each partition you may not be confident of covering all the test scenarios. As already mentioned, it is the boundaries which are always a problem.

When you implement the test cases based on both Boundary Value Analysis and Equivalence Partitioning, you would cover all the test scenarios effectively. It would also save time as it works smart and eliminates exhaustive testing requirement. A test suite implementing these design techniques would be one of the best possible testing solutions.

In a nutshell…

To successfully test a huge application, smart test design techniques are necessary. Understanding and executing the test cases written based on design techniques such as Boundary Value Analysis and Equivalence Partitioning would be helpful in achieving successful testing.

Boundary value analysis and equivalence partitioning both are test case design strategies in black box testing. Boundary value analysis test boundary conditions and equivalence partitioning tests values from logically partitioned data classes.

Employing Boundary value analysis and equivalence partitioning techniques to design the test cases would ensure high coverage of test scenarios and would assure quality testing strategy.

If you implement Boundary value analysis and equivalence partitioning techniques in test suite design and execute the test cases accordingly, you can expect least number of issues when the system goes Live. These test cases would be relevant even after the project comes under maintenance.

Testing phase is vital for the success of any project. Following the right test case design techniques and efficient implementation of the test cases would be essential for the testing phase to be successful.

Boundary value analysis and equivalence partitioning are absolutely helpful in achieving this success. They are not only reliable but also smart techniques.
It is the responsibility of the test teams to understand and apply these techniques to produce quality testing results.


I hope this article has given some insight about the two design techniques. Please go ahead and fill in the comments section with your valuable feedback. Do not forget to share this article.

 

Share article