Picture the first morning of an online admission portal at a public university. The form says applicants must be between 18 and 30 years old, both ends included. The programmer wrote age >= 18 and age < 30. One character is missing: a < stands where <= belongs. Everything else works. Thousands of people apply, and a few hundred of them are exactly 30. Each one gets the message "Age not allowed". By noon the helpline is jammed, and by evening a news site has a headline.
How many tests would have caught it? One. A tester who typed 30 into the age box would have seen the wrong message on the first try. Not a thousand tests; one, if it is the right one. Choosing that one is a skill, and it has a name.
That skill is the first of three questions this chapter answers. Out of billions of possible inputs, which few should you try? Once someone fixes the bug, how do you know the fix did not break something that used to work? And when a test does fail, how do you find the one wrong line in ten thousand? These are the three halves of the chapter: designing tests, knowing the kinds of testing, and debugging.
By the end you will design tests for a field or a rule without looking at the code (equivalence partitioning, boundary value analysis, decision tables, state-transition testing, pairwise selection), write the test cases and defect reports that go with them, and follow a defect through its life cycle. You will tell smoke from sanity, retesting from regression and load from stress, debug a failing program in four ways, work out when automation pays, and explain test-driven development from a run you have seen.
We go in eight parts, from easy to harder: the black, white and grey boxes; equivalence classes and boundaries; decision tables, state machines and the rest of the toolbox; one whole worked case, the 4-digit PIN login; test cases, plans and defect reports; the kinds of testing; debugging; and finally automation, tools, metrics and test-driven development.