Boundary Value Analysis

Profile picture for user devraj

Boundary Value Analysis (BVA) is a systematic testing technique used to evaluate the behavior of a system at the edges of its input domain. It is a Black box testing method that specifically targets the boundary values of valid and invalid partitions. BVA is an extension of equivalence partitioning and is used to test ordered and numeric data, such as sequences, ranges, or intervals. The technique involves identifying each partition's minimum and maximum values (i.e., first and last values, start and end values, or lower and upper values) and testing the system's behavior at these boundary points. This approach helps to ensure that the system functions correctly and consistently across the entire input domain.

The behavior of a system at the boundaries of equivalence partitions is often found to be more prone to errors than behavior within the partitions. As a result, testing at these boundary points is crucial in identifying potential defects, ultimately improving the overall quality and reliability of the system.

Boundary Value Analysis (BVA) is a versatile testing technique that can be applied across all levels of testing. This method is particularly useful for testing requirements that involve a range of numbers, such as dates and times. When multiple variables for the same application are being evaluated, BVA can be used in conjunction with the single fault assumption.

Table of Contents

  1. Valid and Invalid Boundary Values
  2. Boundary Value Analysis Example
  3. Test Coverage in Boundary Value Analysis
  4. Advantages of Boundary Value Analysis
  5. Disadvantages of Boundary Value Analysis
  6. Video Tutorial

Valid and Invalid Boundary Values

A boundary value for a valid partition is considered a valid boundary value, while a boundary value for an invalid partition is considered an invalid boundary value. There are typically two types of invalid partitions: too high and too low, which refer to values that fall outside the predefined upper and lower limits, respectively.

There are two ways to apply BVA – Two-Point Analysis (i.e., Two values testing) and Three-Point Analysis (i.e., Three values testing). The values are based on the risk associated with the item being tested,  with the three-boundary approach being used for the higher-risk items.

If (Min, Max) is the range given for field validation, then For 2-point analysis, boundary values are calculated as follows:

  • Invalid Boundary Values { Min - 1 ; Max + 1 }   
  • Valid Boundary Values {Min; Max }

For 3-point analysis, boundary values are calculated as follows:

  • Invalid Boundary Values { Min-1 ; Max + 1 }   
  • Valid Boundary Values {Min; Min + 1 ; Max - 1; Max }    

Min and Max can also be represented as LB (Left Boundary) or RB (Right Boundary.)

Boundary Value Analysis Example

In the scenario of a bank's credit card approval process, where applicants are required to be between the ages of 21 and 55, BVA can be applied to test the validity of the age inputs.

For the 3-point analysis, the boundary values are calculated as follows:

  • Invalid Boundary Values: {Min - 1 = 20; Max + 1 = 56} 
  • Valid Boundary Values: {Min = 21; Min + 1 = 22 ; Max - 1 = 54; Max = 55}

For the 2-point analysis, values 22 and 54 will not be considered. Thus the boundary values, in this case, would be: 

  • Invalid Boundary Values: {Min - 1 = 20; Max + 1 = 56} 
  • Valid Boundary Values: {Min = 21; Max = 55}

Test Coverage in Boundary Value Analysis

Boundary coverage for a partition is measured as the number of boundary values tested divided by the total number of identified boundary test values, usually expressed as a percentage.

Advantages of Boundary Value Analysis

This method has several advantages, including:

  • BVA focuses on testing the system's behavior at the boundaries of the input domain, where defects are more likely to occur. This approach makes it easier and faster to identify potential issues and improve the overall quality and reliability of the system.
    BVA is a systematic approach designed to thoroughly cover the input domain while minimizing the required test cases. This can lead to a more efficient testing process and help to lower costs and resources required for testing.

Disadvantages of Boundary Value Analysis

Boundary Value Analysis (BVA) is a widely used testing technique. However, like any other testing technique, it also has some limitations, including:

  • To design effective test cases using BVA, a good understanding of the requirements is needed. Without this understanding, it can be challenging to identify the correct boundaries for testing, which can lead to a less effective testing process.
  • BVA is a more advanced testing technique that requires experience and expertise to be used effectively. This is particularly true when testing complex systems, which can be challenging even for experienced testers.
  • BVA can only be used when the partition is ordered and consists of numeric or sequential data. This means it is not applicable for testing unordered or non-numeric data.