I currently use Clover to measure the code coverage of my Java code. One feature which I rely on is the ability to exclude arbitrary sections of code from coverage reports:
///CLOVER:OFF because this case is simpler to verify by code read
if (lFile.isFile() &&
lFile.getName().endsWith(FILE_EXTN) &&
!lFile.delete())
{
throw new IOException("delete() failed for: " + lFile);
}
///CLOVER:ON
I find this kind of exclusion makes it much easier to focus on testing the interesting logic while still achieving 100% code coverage.
Are there any other Java code coverage tools (either free or paid) which support this kind of fine grained exclusion? Whole class or whole method exclusions aren't good enough.
NOTE: I am currently investigating adding something suitable to JaCoCo (Issue #14).
Followings are open source java code coverage tools. Those may help you NoUnit InsECT Jester JVMDI Code Coverage Analyser GroboCodeCoverage jcoverage/gpl JBlanket Cobertura Coverlipse Hansel CodeCover EMMA PIT
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With