Boundary value analysis
Test the limit and its neighbors
Off-by-one bugs live at the edge of a rule: < written as <=, overtime counted from the second hour, the last page dropped when it is only partly full. Boundary value analysis tests the limit itself and the value one step either side. For “reorder when stock is below the minimum”, that means the minimum (no reorder) and one below it (reorder). A value far from the limit gives the same answer in the correct code and in the broken one, so it proves nothing about the boundary.
How the exercises check your tests
Each task gives you a small Python module and its contract. You write pytest tests, and they run against the correct module and two versions with one boundary bug each. The suite passes only when it accepts the correct code and fails both broken versions through an assertion. Hidden checks change the module’s limits, so write subject.MINIMUM - 1, not a copied number. The lesson before this one covers equivalence partitioning, which decides which groups of inputs need a test.