Testing Dr. Andrew Wallace PhD BEng(hons) EurIng
Overview Aims Testing Static Testing Dynamic Testing
Aims Correctness (verification) Requirements Time Space Reliability (validation) Maintainability (regression)
Aims Test each module / function Integrate and test larger units Test whole program
Aims Formal reviews Standards Measurements
Testing What to test for? What can be tested for? What does the test actually tell us? When to test?
Testing Static Testing Analysis the code Logical analysis Dynamic Testing Running the code Debugging
Static Testing Informal Look through the code Get someone else to do it! Check standards Check loops / reachability Check variables Check documentation
Static Testing Metrics Code size Lines of code Lines of comments 5.5 errors per lines of code Complexity
Dynamic Testing input Code to Test Measured response
Dynamic Testing Software specification Test Cases Test Scripts Desired results Code execution Compare results
Dynamic Testing Test cases? Derived from specification Valid input? Invalid input? > max? < min? Test plan? Memory leaks?
Dynamic Testing Coverage Statement coverage Sc = s/S (s = statements executed, S= total number of statements) Decision coverage Dc = d/D (d = number of decision evaluated, D = total number of possible decisions) Path coverage Pc = p/P (p = number of paths executed, P = total number of paths)
Boxes Black box White box
Questions