Boundary value analysis is strongly related to equivalence partitioning as it is focused on testing the boundaries between partitions.
In the example below, -1, 0, 10000, 1000.01, 30000, 3000.01, 60000, 6000.01 are boundary values. They define the boundaries of each partition.
It is important to create test cases for each boundary value in order to verify that the software treats these conditions properly.
At a minimum, we need one test case for each equivalence partition and one test case for each boundary value.
Consider an application that calculates income tax based on the following rules:
Consider N the amount of income
Use equivalence partitioning and boundary value analysis in order to determine:
Invalid partition | 0% tax | 10% tax | 20% tax | 50% tax | Invalid Partition |
---|---|---|---|---|---|
-1 | 0 10000 | 1000.01 30000 | 3000.01 60000 | 6000.01 ? | ? |
Upper limit of income N is not specified. In practice we will conduct some investigation. For example the upper limit may be determined by the size of the database column where that value is stored.
Disregarding the upper limit we have five equivalence partitions and eight boundary values. A minimum of 13 tests will provide a good coverage