A test case is an input for which the expected result is known in advance, from the specification, together with that expected result. A test case passes when the function returns the expected result and fails otherwise. A boundary case is a test case at the edge between two kinds of input that the specification treats differently.
leap_year, with one test year in each. Sam’s three tries came from the two outer kinds and from the innermost one, never from the third.return; the last one in both of its outcomes.Ejemplos
Example 1.11 (Tests for leap_year)
One year of each kind: , , , ; the edge of the precondition: , which is not a leap year. Sam’s original function fails exactly one of these five tests, the one for . Any set of tests that misses the third kind misses her bug, however many years it contains.