At eight o'clock on the morning that Eid train tickets go on sale, a great many people press the same button at the same moment. If, for that one minute, the booking site sells one seat twice, the damage is not small. There are thousands of angry phone calls, a news item by noon, and a question in a ministry meeting by evening. The programmers did not want this. They are good programmers. The bug was there anyway, and the only question that mattered was who would find it first: a tester a month earlier, or the passengers on the day.
That is what testing is for. It is the work of finding the failure before the public does, and of knowing how much you can trust the software when you stop looking. It is also one of the most reliably asked topics in IT papers for banks, BPSC and BCS: definitions, differences, levels, a small count, a small calculation.
By the end of this chapter you will be able to separate error, fault and failure and say why testing can never be complete. You will explain verification and validation and place the four test levels (unit, integration, system, acceptance) in order, with the stubs and drivers each integration strategy needs. You will tell alpha from beta testing, and describe how you would test an ATM, even a distributed one. You will say what black-box, white-box and grey-box testing each see, and then do the white-box work yourself: measure statement, branch, condition and path coverage on real code, compute cyclomatic complexity three ways, and derive a basis set of tests.
We go in six parts, from easy to hard. Part 1 is what testing is and why it is never finished. Part 2 is verification and validation. Part 3 is the four levels, the longest part. Part 4 is the view from outside and from inside the program. Parts 5 and 6 open the code: coverage first, then cyclomatic complexity. Writing test cases from the specification (equivalence classes, boundaries, decision tables, state transitions) is the subject of the next lesson.