How many test cases are enough?

Defects tend to hide at the boundaries between conditions. If delivery is free on orders of ¥100 or more, the dangerous inputs are 99, 100 and 101. Testing those points deliberately is boundary value analysis, one of the most widely used techniques in practice.
How many cases to place near a boundary, and where, has nevertheless been left to experience. This work formulates the selection of boundary test cases as an optimisation problem and derives the choice that maximises the probability of finding a defect within a fixed number of tests.
It has since been extended with machine learning that estimates the boundary itself, bringing programs without an explicit specification within reach.
Source paper
Optimal test case generation for boundary value analysis
Software Quality Journal (2024)