Features – Code Coverage
Start at the dashboard
Clover's dashboard rolls up essential testing data in a single screen, so you can quickly drill down and find actionable information. At a glance you can see:
- top project risks
- coverage 'tree map' of the entire code base
- most complex packages and classes
- least tested methods
- pass/fail/error results and coverage of the latest test run
- scatter chart of class complexity vs. coverage with click-through support
Where to test first?
Your team is too busy to write tests that don't matter. Clover quickly tells you which under-tested classes are most risky, and where a little testing will go a long ways.
- Project Risks show the packages and classes that are most complex yet least covered.
- Quick Wins show the packages and classes with the most untested elements.
Write tests that matter
The last thing your team should be doing is writing trivial tests intended only to raise absolute code coverage. Clover filtering lets you easily control which code counts towards your coverage measurements. You might exclude:
- get() and set() methods
- catch{} and finally{} blocks
- private methods
- logging statements
Clover gives you complete control over what does and doesn't count towards coverage, so your test writing time will be spent effectively.
Learn more about coverage filtering
Track coverage (and more) over time
Is code coverage dropping as your release date nears? What classes has been recently added, and how well are they covered? What classes are gaining or losing code coverage? With Clover historical reports, the answer to these questions and more are easily obtained. Clover lets you track the following and more across your code bases lifetime:
- % Covered elements, methods, branches and statements
- total LoC, non-covered LoC, complexity, # classes, # of packages
- classes added, classes gaining/losing coverage, during the last x days/weeks/months
What's that test doing?
As your code base changes over time, so must your tests. Clover's per-test coverage quickly shows you exactly which classes your tests are testing, and how much coverage they provide, enabling you to keep your tests up-to-date and effective as the codebase evolves.
Clover lets you drill down to the individual line of code and determine:
- was the statement tested (green) or not (red)
- how many times was the statement executed
- classes added, classes gaining/losing coverage, during the last x days/weeks/months
As you're changing or debugging your code, per-test coverage quickly answers key questions:
- Do I need to create or modify tests for a class, method or line of code I just modified?
- Why didn't unit tests detect a bug in a particular class, method or line of code?
- How confident can we be that our tests will sufficiently cover a changed class, method or line of code?
Check out the blog post "My test touched what?!