Integration Test Code Coverage with SonarQube and Jacoco

It’s hepful to separate integration tests from unit tests in a Java project to run them independently. But how do you generate a combined code coverage metric? In this article you’ll discover exactly how, with a full example project which publishes Jacoco code coverage stats to SonarQube. Code coverage for unit tests A code coverage metric tells you what percentage of your proudction code is covered by tests. The higher the better....

Published 18 Apr 2022 · 5 min read · Tom Gregory

SonarQube branch analysis

SonarQube helps us improve code quality using static analysis techniques. You can even add quality gates to fail your CI pipeline if the master branch doesn’t meet your requirements. Why not also apply the same technique to feature branches? In this article you’ll learn how to setup SonarQube branch analysis to check the quality of both master and feature branches, finding potential issues even earlier in the development lifecycle. SonarQube branch analysis version compatibility SonarQube branch analysis is only available for specific editions of SonarQube....

Published 5 Apr 2021 · 6 min read · Tom Gregory

Add SonarQube quality gates to your Jenkins build pipeline

Learn to add SonarQube analysis and quality gate stages to a Jenkins pipeline.

Published 19 Oct 2020 · 10 min read · Tom Gregory

How to Measure Code Coverage Using SonarQube and Jacoco

Code coverage is a metric that teams use to measure the quality of their tests, and it represents the percentage of production code that has been tested. Discover how to apply the Gradle Jacoco plugin to your project and run a SonarQube scan to generate a code coverage report. UPDATED in November 2021 to reflect SonarQube LTS version switching to 8.9. 1. Overview SonarQube is a tool which aims to improve the quality of your code using static analysis techniques to report:...

Published 13 Dec 2019 · 7 min read · Tom Gregory