Coverage with Jacoco and Sonarqube

In most projects I have worked in, Jacoco was used as tool to determine code coverage. The configuration is fairly easy as it plugs into the JVM that runs the tests using an agent that tracks the invocations. In maven, this JVM is forked by the surefire plugin and the parameters are auto generated. The setup is well documented so in this blog post I want to shed some lights on the internals of Jacoco and Sonarqube and how both calculate their coverage metrics. I did some code digging, and I’d like to share my insights. The following information is a compilation of what I found out.

This article is inspired by this question on StackOverflow, which is basically about how Sonarqube and Jacoco calculate coverage.

Continue reading

Multi-Module Integration Test Coverage with Jacoco and Sonar

In this article I describe how to setup jacoco for Maven multi-module projects so that integration test coverage can be calculated for the entire code base and analyzed using Sonarqube.

Continue reading

Sonarqube: Mutation Analysis Plugin

The Mutation Analysis Plugin provides metrics and issue management for mutation test results produced by Pitest Mutation Testing. Mutation testing helps you discover gaps in and assess the quality and effectiveness of your automated Unit Test Suites.

Continue reading