Boundary Value Analysis

Go back to Tutorial

Boundary value analysis is a software testing technique in which tests are designed to include representatives of boundary values. Values on the edge of an equivalence partition or at the smallest value on either side of an edge. The values could be either input or output ranges of a software component. Since these boundaries are common locations for errors that result in software faults they are frequently exercised in test cases.

Applying boundary value analysis

The expected input and output values should be extracted from the component specification. The input and output values to the software component are then grouped into sets with identifiable boundaries. Each set, or partition, contains values that are expected to be processed by the component in the same way. Partitioning of test data ranges is explained in the equivalence partitioning test case design technique. It is important to consider both valid and invalid partitions when designing test cases.

For an example, if the input values were months of the year expressed as integers, the input parameter ‘month’ might have the following partitions:

… -2 -1  0 1 ………….. 12 13  14  15 …..

—————-|———–|———————

Invalid partition 1   valid partition     invalid partition 2

The boundaries are the values on and around the beginning and end of a partition. If possible test cases should be created to generate inputs or outputs that will fall on and to either side of each boundary. This would result in three cases per boundary. The test cases on each side of a boundary should be in the smallest increment possible for the component under test. In the example above there are boundary values at 0,1,2 and 11,12,13. If the input values were defined as decimal data type with 2 decimal places then the smallest increment would be the 0.01.

Where a boundary value falls within the invalid partition the test case is designed to ensure the software component handles the value in a controlled manner. Boundary value analysis can be used throughout the testing cycle and is equally applicable at all testing phases.

After determining the necessary test cases with equivalence partitioning and subsequent boundary value analysis, it is necessary to define the combination of the test cases when there are multiple inputs to a software component.

Guidelines for Boundary Value analysis

  • If an input condition is restricted between values x and y, then the test cases should be designed with values x and y as well as values which are above and below x and y.
  • If an input condition is a large number of values, the test case should be developed which need to exercise the minimum and maximum numbers. Here, values above and below the minimum and maximum values are also tested.
  • Apply guidelines 1 and 2 to output conditions. It gives an output which reflects the minimum and the maximum values expected. It also tests the below or above values.

Example:

Input condition is valid between 1 to 10

Boundary values 0,1,2 and 9,10,11

Go back to Tutorial

Share this post
[social_warfare]
State Transition Testing
Equivalence Partitioning

Get industry recognized certification – Contact us

keyboard_arrow_up