To set up boundary value analysis test cases you first have to
determine which boundaries you have at the interface of a software
component. This has to be done by applying the equivalence partitioning
technique. Boundary value analysis and equivalence partitioning are
inevitably linked together. For the example of the month in a date you
would have the following partitions:
Applying boundary value analysis you have to select now a test case at
each side of the boundary between two partitions. In the above example
this would be 0 and 1 for the lower boundary as well as 12 and 13 for
the upper boundary. Each of these pairs consists of a "clean" and a
"dirty" test case. A "clean" test case should give you a valid operation
result of your program. A "dirty" test case should lead to a correct and
specified input error treatment such as the limiting of values, the
usage of a substitute value, or in case of a program with a user
interface, it has to lead to warning and request to enter correct data.
The boundary value analysis can have 6 testcases.n, n-1,n+1 for the
upper limit and n, n-1,n+1 for the lower limit.
A further set of boundaries has to be considered when you set up your
test cases. A solid testing strategy also has to consider the natural
boundaries of the data types used in the program. If you are working
with signed values this is especially the range around zero (-1, 0, +1).
Similar to the typical range check faults, programmers tend to have
weaknesses in their programs in this range. e.g. this could be a
division by zero problem where a zero value may occur although the
programmer always thought the range started at 1. It could be a sign
problem when a value turns out to be negative in some rare cases,
although the programmer always expected it to be positive. Even if this
critical natural boundary is clearly within an equivalence partition it
should lead to additional test cases checking the range around zero. A
further natural boundary is the natural lower and upper limit of the
data type itself. E.g. an unsigned 8-bit value has the range of 0 to
255. A good test strategy would also check how the program reacts at an
input of -1 and 0 as well as 255 and 256.
The tendency is to relate boundary value analysis more to the so
called black box testing ,which is strictly checking a software
component at its interfaces, without consideration of internal
structures of the software. But looking closer at the subject, there are
cases where it applies also to white box testing.
After determining the necessary test cases with equivalence
partitioning and subsequent boundary value analysis, it is necessary to
define the combinations of the test cases when there are multiple inputs
to a software component.