In the past, I’ve used these graphs to show Before and After snapshots of various projects after a small refactoring effort. In this blog I want to show you a healthy project’s codebase and highlight somethings that makes me feel comfortable about the codebase. (Actually there is not much to talk, a picture is worth a thousand words.)
Following is the code coverage report from a project:
Couple of quick observations:
- Majority of the code has coverage over 75% (Our goal is not to have every single class with 100% code coverage. Code Coverage does not talk about Quality of your tests.)
- There is a decent distribution of code across packages, classes and methods. (No large boxes standing out.)
- You don’t see large black patches (ones you see are classes that were mocked out for testing).
Lets look at the complexity graph:
- Except for a couple of methods, most of them have Cyclomatic Complexity under 5.
- You don’t see large red or black boxes which are clear indicators of complex code.