Search code examples
javacode-coveragecoberturaeclemma

Why code coverage is different when measured by eCobertura and EclEmma?


When using eCobertura and EclEmma resp. I found the code coverage come out as different in each case for the same project. Interested to know why?

Emma stat EclEmma stat

eCobertura stat

eCobertura stat


Solution

  • One factor may be that EclEmma does not measure coverage correctly for exception handling code - i.e. it may tell you that code is not covered, when in fact it is executed (e.g. if you step through with the debugger, the code is indeed executed). This is a limitation of the underlying JaCoCo library. No idea whether eCobertura has the same issue though.