DevOps
Sonar tightly integrates with the most popular DevOps platforms, such as GitLab, Jenkins, and Azure DevOps, allowing you to collect code coverage data during your build phases.
An important part of what makes code high quality code is that it fulfills a desired outcome and is testable. Unit testing verifies if code meets that intended outcome and proves that it is testable. SonarQube acts as a central hub, collecting code test coverage and presenting it as clear pass/fail metrics in a quality gate that prevents substandard code from reaching production.
Thoroughly testing your code is key to maintaining its quality and reliability. It ensures that it behaves as expected under specific scenarios and produces the correct results based on given inputs. With clear code test coverage metrics, teams can prioritize gaps in code test coverage and determine where to focus effort in order to meet your code test coverage target.
Higher code test coverage means more of your code is being tested and has been proven to be testable. This leads to improved code maintainability because testable code proves modularity. Over time, consistent code test coverage targets create a feedback loop that guide better design decisions and more modular code.
In order to include code coverage results in your analysis, you must set up a third-party code test coverage tool and configure SonarQube Server to import the results produced by that tool. SonarQube integrates with multiple code test coverage tools.
Assess the overall health of your code by importing your code test coverage test results into SonarQube Server and Cloud in over 40 programming languages.
A well-tested codebase with high code test coverage gives developers confidence, minimizing the risk of introducing new code quality issues in production.
Displays code test coverage as a percentage of the amount of code including clear pass/fail metrics of your desired test coverage goals.
SonarQube clearly highlights untested lines of code so you can easily make decisions on where gaps in code test coverage exist.
Code test coverage metrics assist with measuring test effectiveness, improving code quality, reliability and maintainability.
Sonarqube guides developers to focus on building tests for new code to ensure new code meets your code test coverage standards. This improves productivity by narrowing developer focus on what matters most.
Seamlessly integrated where you work: in the IDE, in DevOps platforms, and in Slack so you don’t have to leave your tools to get the code health details you need.
SELF-MANAGED
Calculate and store code test coverage metrics (line, condition, new code) based on data generated by external, third-party tools both on-premise or in the cloud. Receive detailed reports that visualize test coverage percentages and identify areas with low test coverage. Use quality profiles to define minimum code test coverage thresholds.
SaaS
Calculate and store code test coverage metrics (line, condition, new code) based on data generated by external, third-party tools hosted in the cloud. Receive detailed reports that visualize test coverage percentages and identify areas with low test coverage. Use quality profiles to define minimum code test coverage thresholds.
"Sonar helps our development team confidently make both AI-assisted and human-developed code fit for production by reviewing and establishing rules of good programming practices"
Dario Flores, Technical Quality Specialist
Dario Flores, Technical Quality Specialist
"Sonar helps our development team confidently make both AI-assisted and human-developed code fit for production by reviewing and establishing rules of good programming practices"
Code test coverage represents the percentage of source code that is executed by testing, providing insight into which lines, branches, or conditions are verified by your test suite. With SonarQube, code test coverage metrics are displayed right in the quality gate at critical stages of development. Every line of code that is not covered by tests is highlighted, enabling development teams to better understand which parts of their codebase are covered by testing and which parts are lacking test coverage.
Tracking code test coverage helps teams focus on gaps in testing and identify risky, untested areas. SonarQube integrates code test coverage directly into its analysis workflow, enabling a continuous feedback loop that drives teams to maintain quality code and achieve reliable, maintainable software projects.
