Branch coverage with JaCoCo, Emma from IntelliJ

code-coverage, intellij-idea, junit, unit-testing

Solution

Actually IntelliJ code coverage tool supports branch coverage though it does not show the results on the summary. Check this article to see how it can be configured and how you can check your branch coverage: https://confluence.jetbrains.com/display/IDEADEV/IDEA+Coverage+Runner The key is to use Tracing instead of Sampling.

Problem

I am trying to measure branch coverage of unit tests for a large Grails application. I am using JaCoCo, Emma and IDEA to collect the metrics from inside IntelliJ, I am getting the following: - JaCoCo (no metrics are shown even for line coverage) - Emma (produces method and line coverage) - IDEA (produces class, method and line coverage) I am mostly interested in JaCoCo as it should give me Branch Coverage by default. Could someone point me to some tips on how to troubleshoot this?

Original source