Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java code coverage tools which support source line exclusions

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).

like image 754
mchr Avatar asked Nov 14 '12 09:11

mchr


1 Answers

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

like image 66
Ruchira Gayan Ranaweera Avatar answered Sep 29 '22 20:09

Ruchira Gayan Ranaweera