Boundary value analysis is a refinement of the equivalence class partitioning method which again is one of the most generally applicable methods for black-box test design. The idea of equivalence class partitioning is to divide the all possible inputs to the system into “equivalence classes”, i.e. sets of inputs that should produce “analogous” results and “work the same”. As a simple example, let’s take a ticketing system where children under age 6 are allowed to travel for free, people under 18 as well as senior people older than 64 pay $10 while adults need to pay $20. For testing this system, we can use equivalence class partitioning to design our tests.
When the equivalence classes involve numbers, there are decision boundaries between them. These are places where the behavior of the system changes. What makes boundary value analysis an interesting method is that it is widely recognized that values on the boundaries cause more errors in system. Therefore we should be always checking the boundaries as if the system fails, it is likely to fail on these decision boundaries.
In the example above, there are decision boundaries around age 0, 6, 18 and finally around age 64. First, the age cannot obviously be less than 0; children between 0 to 5 years can travel for free, while at age 6 they are charged for $10. When you turn 18 you need to pay the full price of $20. Finally when you turn 64 you get senior discount. If boundary value analysis is applied to this example, we as an example could get the following tests to test the boundary around 0 and 6:
|Test||Expected Result||Equivalence Class|
|-2||Reject the input||Negative value is invalid|
|-1||Reject the input||The greatest value that is still invalid|
|0||Travel for free||Children under 6 (the smallest value in this class)|
|1||Travel for free||Children under 6|
|4||Travel for free||Children under 6|
|5||Travel for free||Children under 6 (the greatest value in this class)|
|6||Pay $10||Children between 6 and 17 (the smallest value in this class)|
|7||Pay $10||Children between 6 and 17|
One of the problems with equivalence class partitioning and boundary value analysis is that they are typically explained with simple examples like the one above, while in the real world these methods need to be applied in relation to every equivalence class of the reachable system states of the application that we are testing. For real world systems, carrying this out manually easily become prohibitively difficult.
Conformiq Designer implements automatic equivalence class partitioning and boundary value analysis across the whole system specification (as encoded in a model). The tool is able to generate test suites that cover the equivalence classes and boundary value cases (and if not produce a report of what we failed to cover during the test generation) that at the same time are of reasonable size with full coverage and traceability information. You are relieved from doing equivalence class partitioning and boundary value analysis by hand, a time-consuming and error-prone process that is also very complicated for larger systems.