Equivalence partitioning
One value from each class
Most inputs behave like their neighbors: ages 30 and 41 both pay the adult price, so testing both adds nothing. Equivalence partitioning splits the possible inputs into classes the contract treats alike, then tests one representative from each. Find the classes in the contract, not in the code: child, adult and senior prices are three classes, an invalid country code is a fourth kind of input, and two inputs together can make a grid of classes, such as a member below the discount threshold.
The forgotten class
A bug that breaks only one class passes every test of the other classes. In these exercises your pytest tests run against the correct module and against two versions that each mishandle a single class: seniors charged the full price, a password with two problems reported as one. Your suite passes only when it catches both, so it has to cover every class. Hidden checks change the module’s constants, so build inputs from them. The next lesson, boundary value analysis, picks the values at the edge of each class.