Eclipse Collections has recently added a code coverage report via Jacoco using GitHub actions. For those not familiar, Jacoco is a free code coverage library. In short, it measures how much of our code has test coverage.
With this addition, anyone willing to contribute to Eclipse Collections can download the report, look for parts of code not covered by tests, and submit a PR with new tests that will improve the coverage.
The new report is available at Eclipse Collections GitHub Repository -> Action -> Coverage Report.
To generate a human-readable report, we need to use the report goal on our project pom.xml file. With this goal, JaCoCo can generate the report in different formats (e.g. HTML, XML, CSV) that help us interpret the result. Below is an example of the report.
The report is simple and easy to navigate and you’ve different sorting options.
Now you can easily spot pieces of code without coverage, write the tests for it and contribute to Eclipse Collections.