Better Code via Coverage Analysis during Testing



James E Keenan

PPW 2007
October 14, 2007


Table of Contents

1. Preliminaries
2. What This Talk Will Not Cover
3. To Learn More about Testing
4. What This Talk Will Cover

5. Coverage Analysis Basics
6. Types of Coverage Analysis
8. General Form of Coverage Analysis
9. Goal of Coverage Analysis

10. Testing in Perl
11. How Do We Conduct Formal Testing in Perl?
12. Testing Individual Code Elements
14. Most Typical Case:
15. Organizing Reports of Test Results

17. Coverage Analysis in Perl
18. Cover
19. Testing a CPAN-Style Distribution with ExtUtils::MakeMaker
20. Running the Tests
22. Use a Shell Function to Save Keystrokes
23. Testing a CPAN-Style Distribution with Module::Build
24. Running the Tests
25. Testing Code Not in a CPAN-Style Distribution with 'prove'
26. Generating Coverage Reports
27. Viewing Coverage Reports
28. Coverage Summary
29. File Coverage
30. stmt
31. bran
32. cond
33. sub
34. pod
35. time
36. Branch Coverage
38. Condition Coverage

39. Command-Line Options for 'cover'
40. 'cover' Reporting Options
42. 'cover': Report Plain Text
43. 'cover': Select Your Reporting Categories
44. 'cover': Select Your Own Directory
45. 'cover': Choose Files to Exclude from Reporting

47. Improving Your Test Coverage
48. How to Improve Your Test Coverage:

54. Difficulties in Coverage Analysis
55. Limitations of Devel::Cover

56. References
57. And Now, As Promised ...

58. Bonus Slides
59. Steve Peters' ExtUtils::MakeMaker::Coverage
60. 'gcov' and Coverage of XS Code
62. Coverage Reporting from Multiple Databases
63. Error Conditions and 'Uncoverable' Code