Why the code coverage statstics is fluctuating?

45 views
Skip to first unread message

Yiichan Sun

unread,
Oct 25, 2023, 5:23:54 AM10/25/23
to JaCoCo and EclEmma Users
My team use Jacoco one year ago. We integrated Jacoco with Codecov in Github workflow, and set a periodical action to generate code coverage report every day. However, the coverage changes dramatically. Even We don't change any code, the next day it gives us a changed code coverage. Especially when running integration tests.

So I just want to know:
1. what makes the code coverage fluctuating so fast, even no more new commits? Due to the mechanism of running many tests in concurrency?
2. Or something wrong in the aggregation of integration tests report?
3. what's the mechanism of the generation of integration test code coverage report in Jacoco?

Thanks!

Marc Hoffmann

unread,
Oct 27, 2023, 1:50:45 AM10/27/23
to JaCoCo and EclEmma Users
Hi Yiichan,

it is hard to tell what causes this in your setup. I would start with comparing two reports with different coverage figures. Drill-down both reports and try to find a pattern where coverage changes. It might be caused by non-deterministic tests or problems with the test setup or execution data collection.

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/94663a4c-8a4d-4a60-a4d9-f5fe5dfb196fn%40googlegroups.com.

Bowen (Tony) Sun

unread,
Oct 27, 2023, 4:41:13 AM10/27/23
to JaCoCo and EclEmma Users
OK, thanks! But if I want to know the mechanism how Jacoco generating code coverage, are there any useful materials? I have read the official doc(https://www.jacoco.org/jacoco/trunk/doc/counters.html), while there are little useful information.

Marc Hoffmann

unread,
Oct 27, 2023, 10:34:04 AM10/27/23
to jac...@googlegroups.com
The following chapters describe the implementation details:


If you want to go deeper you can explore the source code which is well documented and tested.

Regards,
-marc



Reply all
Reply to author
Forward
0 new messages