TESTING
I. INTRODUCTION
¥ Definition: Verify the Behavior of a Program by Executing it With a Suitable Set of Test Cases (Inputs).
¥ Triangle Example (Meyerson)
Give a set of test cases for a program that inputs 3 integers,
interprets these as the lengths of the sides of a triangle, and
displays a message indicating whether the triangle is scalene,
isosceles, or equilateral.
¥ Testing Costs: ® 50% of $development (Boehm, Korel)
Errors still exist in (almost?) all non-trivial software.
¥ Some Issues and Problems
* Dijkstra: " Program testing can be used to show the presence
of bugs, but never to show their absence."
* Exhaustive Testing: Usually Impossible
* Complete Coverage: D = È Di
D = { possible inputs}, Di = equivalence class
(1 test is sufficient)
Determining Di and ideal test sets is undecidable.
* More test cases are not always better than less (p.267).
* Randomly generated test cases aren't always appropriate (p.262).
* Software is not continuous (p.261).
Given that f(input) = output, f(input + e ) ¹ output + d (often).