Getty Images/iStockphoto

Tip

How boundary value analysis boosts test efficiency

Boundary value analysis provides multiple benefits, including increased test coverage and proactive defect prevention. It's a simple way to improve test efficiency.

Software testers use the boundary value analysis (BVA) technique to quickly identify errors in input fields within any application. BVA helps reduce repetitive or duplicate test efforts, thereby increasing testing efficiency and speed.

Borrowed from foundational mathematical equations and incorporated into testing in the 1980s, BVA remains a common practice today because it reduces errors resulting from poorly defined input fields. By reducing input errors, BVA helps ensure data security and accuracy. When no junk is added, no junk enters the database. A database without junk causes fewer application problems.

Let's look at how test professionals use boundary value analysis and its expected benefits.

How boundary value analysis works

Boundary value analysis is a black-box testing technique used in both manual and automated testing. BVA is typically used in combination with equivalence class partitioning. Both assist testers by verifying input fields and preventing input errors.

BVA helps testers verify functionality with values that are on, inside and outside defined boundaries. Are input fields typically defective? Not necessarily. Still, input field parameters are frequently undefined or loosely defined in requirements. It falls on developers to define the parameters of the field, and often they don't have the information to fully code for all possibilities.

Software testers use BVA to verify a specific input value and a value on either side of it.

As an example, let's consider an application that collects laboratory blood test results. Each test has an assigned range of values where X is considered H, i.e., high, and Y, where the value is L, i.e., low. A professional software tester uses the full range of possible values for each lab test and creates a set of possible values. It is time-consuming and frequently unnecessary to execute tests on all possible values.

Using BVA, a software tester creates a boundary-testing set of values for each lab result. HDL cholesterol values can include 40, 39, 38 and 41. If the ideal value is 40, then 39 and 38 are low; 41 is high. A tester can verify the application's response to both high and low values. If testers need a negative test, they could add in a negative number, such as -40.

By reducing input errors, BVA helps ensure data security and accuracy.

BVA value sets depend on the requirements and specifications of the input field. They vary widely and can include anywhere from three to 30 values. The purpose is to not test every valid or invalid value but to limit the test execution to a precise value set.

Benefits of BVA

The BVA testing technique benefits the test team by providing the following:

  • Detection of input field defects.
  • Expanded test coverage to include input field value verification.
  • Improved application quality by identifying input data problems.
  • Increased compliance with some regulatory and standards requirements.
  • Faster test execution by focusing on limited BVA value test groups.
  • Increased test efficiency and accuracy with focused testing on identified boundary values.
  • Reduced defects from data errors.
  • Proactive testing of fields that might be lacking requirements or detailed specifications.

Using BVA enables testing teams to focus on high-risk or high-priority input values rather than performing a random test of multiple values. High-priority value testing prevents severe or critical defects. Testing critical items first is a best practice for using BVA.

To make the best use of boundary value analysis, consider the following best practices:

  • Select values at the maximum and minimum boundary range.
  • Review requirements or acceptance criteria for input and output boundaries.
  • Ask for input parameter values, if none are specified.
  • Always include values for negative testing to verify error messaging or error handling.

The BVA technique might seem simplistic, but it provides substantial value for defect identification and prevention. BVA also helps prevent junk data from being accepted in input fields and eliminates database errors.

How to choose test values?

With boundary value analysis, a tester needs to determine the values to use. To do so, start by reviewing the requirements, user story acceptance criteria or design specifications. You should find the expected input data type and value ranges for each input field. If none of these exist, test directly in the application.

Discuss your findings with the developer to see if any changes are required. Once you determine the boundaries, create a list of maximum and minimum values within the boundary both positive and negative.

Be sure to include values that are invalid and expected to result in an error. Testing invalid values ensures the application properly handles the errors instead of crashing, freezing or generating other unexpected errors.

Add in a few edge case values that are at the extreme range of input values. For example, if your BVA test value group covers a valid value range of 1-100, then be sure to test 1, -1, 100, -100, 999, and .100. Each of these represents the extreme range of values, both valid and invalid.

Whether an application includes requirements for input fields or leaves it to the developer, BVA is a quick step. Testers can investigate input fields through exploratory testing to determine invalid and valid values. Using BVA in testing helps prevent database errors and obvious user-facing defects. By adding BVA to your testing efforts, you'll improve application quality by preventing defects in input fields throughout the application.

Amy Reichert is a 20-plus-year professional QA tester and a QA lead, specializing in test development, execution and management techniques. Her experience comes from a variety of sources, including ERP systems, architectural design, e-commerce and healthcare software.

Dig Deeper on Software testing tools and techniques

Cloud Computing
App Architecture
ITOperations
TheServerSide.com
SearchAWS
Close