Jacoco Coverage formula

17 views
Skip to first unread message

Marc Pires

unread,
Jul 8, 2022, 2:25:41 PM7/8/22
to JaCoCo and EclEmma Users
Hi everyone, where can I find the formula Jacoco uses to calculate the Coverage. What I am looking for is the actual formula, not only the metrics it uses.

Looking at https://www.jacoco.org/jacoco/trunk/doc/counters.html could not find the related information

Comparing to how SonarQube calculates coverage we have.

 Coverage = (CT+CF+LC)/(2*B+EL)

CT+CF =  (Conditions to Cover -  Uncovered Conditions)
LC =  ( Lines to Cover -  Uncovered Line)
2*B =  (Conditions to Cover already represents the product)
EL =  ( Lines to Cover)

Thanks

Marc Hoffmann

unread,
Jul 8, 2022, 6:19:06 PM7/8/22
to JaCoCo and EclEmma Users
Hi Marc,

there is no “formula” besides what is defined here: https://www.jacoco.org/jacoco/trunk/doc/counters.html

JaCoCo reports just show these counters.

recently learned that Sonar calculates a proprietary metric based on the counters, but this is not what we do in JaCoCo reports.

Best regards,
-marc










--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/c9c4bb80-68cb-4d01-a53f-2dcd2c824692n%40googlegroups.com.

Marc Pires

unread,
Jul 11, 2022, 8:05:47 AM7/11/22
to JaCoCo and EclEmma Users
Thanks
Reply all
Reply to author
Forward
0 new messages