Right-[B]ICEP: Boundary Conditions
Explore how to identify and test boundary conditions in Java applications using the Right-BICEP approach. Understand common edge cases like null inputs, invalid data, integer overflow, and unexpected order, and learn strategies to write effective unit tests that prevent defects related to these conditions.
An obvious happy path through the code might not hit any boundary conditions in the code, which are scenarios that involve the edges of the input domain. Many of the defects you’ll code in your career will involve these corner cases, so you’ll want to cover them with tests.
Boundary conditions:
Boundary conditions we might want to think about include:
- Bogus or inconsistent input values, like a filename of
"!*W:X\&Gi/w$→>$g/h#WQ@. - Badly formatted data, such as an email address missing a top-level domain (fred@foobar).
- Computations that can result in a numeric overflow.
- Empty or missing values, such as