Boundary value analysis

If equivalence classes that describe value ranges are found by the test analyst at the test design stage, it can make sense to also test boundary values of equivalence classes in addition to representatives by means of extra test cases.

Examination of equivalence classes through boundary values is called boundary value analysis.

Boundary values within an equivalence class are each time the lowest and the highest value that are found within a given equivalence class. Additionally, two neighbouring values of both boundary values which are no longer found in the equivalence class are also taken into consideration.

Exactly four boundary values can be determined for an equivalence class:

  • If a traveller aged 0 to 5 does not need to pay a fare, age entries -1, 0, 5 and 6 must be tested in a boundary value analysis.

  • In the case of age values of: 0 years and 5 years, the expected result is that no fare is to be paid.

  • The result for age values of: -1 years and 6 years is to be looked up in the specification.

There are some equivalence classes in which not all boundary values can be determined as the boundary does not correspond to a specific value. If, for example, age entries smaller than 0 are invalid and lead to an error message, the smallest value can be determined not precisely with -∞.

Boundary values are obviously always representative of equivalence classes; however, these values are of special importance from the point of view of a test analyst as errors often occur at boundaries of equivalence classes, such as e.g. "<" used instead of "<=“.

Boundary value overlap can be used as a meaningful metric for the evaluation of the tests performed through a boundary value analysis. It is defined as a quotient of the number of tested boundary values and all contemplated boundary values.

It is difficult to say from which level of coverage a test can be rated as good or sufficient, since this test design procedure is prioritized to a greater or lesser extent de­pen­ding on the objective of the test. When testing the requirements for the first time, one will tend to test many boundary values and when testing a new version, only the representatives will be tested if the value ranges have not changed.