Measure Code Coverage by Integration Tests with Sonar

You probably know already that JaCoCo is the most performant code coverage engine. But you might not know that you can now combine it with Sonar to assess the code coverage by integration tests. This was the most voted Sonar issue (SONAR-613) and the latest version of the Sonar JaCoCo Plugin solves it. I am now going to explain how.

Read the rest of this page »

Sonar has become a Multi-Languages Platform

At the beginning of this year, Freddy mentioned in the Sonar roadmap for 2010 that after version 2.0 the main objective was to enable other languages on the Sonar platform through plugins. Nine months later, we have made very good progress on this subject and I wanted to take a chance to report on it.

Read the rest of this page »

Pick your code coverage tool in Sonar 2.2

By default, Sonar embarks two tools to calculate code coverage by unit tests on java projects : Cobertura and Clover. But last week, we also released plugins for two other coverage tools : Emma and JaCoCo. Both plugins are available in the Sonar Plugin Library. So I thought it would be a good time to compare all of them and share the results with the community.

Read the rest of this page »

Eclipse Sonar Plugin 0.1 in screenshots

The Sonar Team is very proud to announce the availability of the first version of the Sonar Eclipse plugin. This plugin is part of the Sonar IDE Project. This first version comes just few a weeks after the release of the Sonar IntelliJ IDEA plugin. The project has 2 active contributors : Jérémie and myself.

The work has been greatly facilitated by the good feedback we received from the Sonar community on the release candidate version. It is going to be followed by new ones in the upcoming weeks/months (see My proposal for GSoC (Google Summer of Code) 2010).

This version 0.1 only displays violations. Duplicated blocks, code coverage and commented out lines of code will be added later. As for the Sonar IntelliJ IDEA plugin, source code is decorated on the fly with information provided by the Sonar web server.

As usual for releases, let’s go through screenshots to discover this new functionality and how it can be used in your daily work to track violations. Enjoy !

Read the rest of this page »

IntelliJ IDEA Sonar Plugin 0.1 in screenshots

The Sonar Team is very proud to announce the release of the first version of the Sonar IntelliJ IDEA plugin. The Sonar IDE project consists at the moment of two plugins, one for Eclipse and one for IntelliJ IDEA, and has 2 active contributors : Jérémie and myself. This release is going to be followed by new ones in the upcoming weeks/months.

The main objective of the Sonar IDE project is to bring the power of the Sonar platform inside the developer’s IDE. In the initial versions of both plugins, the source code will be decorated on the fly with information provided by the Sonar web server. It means that the footprint of the plugins are very light and the continuous workflow of the developer is not disturbed. Note that source code from Sonar server may be slightly different from source code of the working copy, this is why a heuristic algorithm is used to match violations lines.

Version 0.1 has the following limitations : it only works on Maven projects (feel free to vote for issue SONARIDE-38 if you wish support for non-Maven projects to be added) and only displays violations. Duplicated blocks, code coverage and commented out lines of code will be added later.

As usual for releases, let’s go through screenshots to discover this new functionality and how it can be used in your daily work to track violations. Enjoy !

Read the rest of this page »

Knowing Better Sonar Users

This is sometimes a bit frustrating, when you are contributing to an Open Source project, to have doubts about who your users are… really. Not knowing them might lead to not understand their needs and therefore not being close enough to deliver value.

Despite the fact that we are always ready to answer questions on the mailing lists, the Sonar team wanted to be sure it knows well enough its users and their experience using the platform. That is why we recently made two polls and today I would like to share their results :

Read the rest of this page »

The Flex Plugin for Sonar : a Further Step Toward Multi-Language Support

Earlier on this year, we mentioned in the Sonar roadmap for 2010 that after version 2.0 the main objective was to enable other languages on the platform through plugins. This development is on its way and the first plugin to come out is an Open Source plugin to analyze Flex / ActionScript projects that was released last week.

The version 0.1 of the plugin already enables to get base metrics such as Lines, Comments, Classes, Complexity and Statements with help of FlexMetrics. It also embeds FlexPMD (the equivalent of PMD for ActionScript) to provide an extensible and powerful coding rule engine. Finally it enables to report on duplicated code by using FlexCPD. As usual, all those tools are transparently orchestrated by Sonar to ease the installation and the use of the plugin.

As you can see, the release of this Sonar plugin for Flex projects was not possible without Adobe guys, thanks to François and Xavier, that have developed and keep improving the tools to analyze the code. The next steps for the plugin might consist of integrating FlexUnit for unit tests.

You might want to download the plugin straight away to give it a try, but you can also see it in action on Nemo.

Here are the next milestones in the roadmap of multi-languages :

  • a SonarSource commercial Cobol Plugin planned for the end of April, but that can already be evaluated in beta
  • SQLI, a French consulting company, is currently making a great contribution to deliver an open source plugin to analyze PHP projects
  • A plugin to cover VisualBasic 6

Add CI Build Stability to your Sonar Dashboard

Sonar is known as being the open source platform to evaluate and report continuously on source code quality. Its basic role is to evaluate the code technical debt that slows down productivity. Of course, several factors can lead to a productivity slump and poor code quality is only one of them.
Another one is the effectiveness of the Continuous Integration process. CI practice is directly inspired by Lean Manufacturing practices and the main goal is to “Create a continuous process flow to bring problems to the surface … as quick as possible”. When the Continuous Integration flow fails, this is very good feedback to hear : “Hey guys, stop the line. You first need to fix this issue : compilation failure, unit tests failures…”. But if the CI flow fails too often this is also a bad news as lot of time is spent fixing the problem and not developing new features.

Read the rest of this page »

2009 is over, what is coming up in 2010 for Sonar ?

A change of year always gives to teams an opportunity to look back and measure what was accomplished… and then to start thinking of what the new year should be made of. I thought I’d share the output of the Sonar team retrospective.

At the end of 2008, very few people knew Sonar. The platform was made of a small community of early and eager adopters who were supporting the product strongly by giving feedback, asking for more functionality, making suggestions and testing new versions. It was also made of Sonar 1.5 that, looking back, was the foundation version of the platform. From this version, here is what was achieved in a year :

  • A dynamic development activity on Sonar core with 7 major releases since 1.5.
  • The transformation of Sonar from a tool to an extensible platform with more than 20 extension points.
  • More than 30 open source plugins have been build to extend Sonar core using those APIs, and more that are not open source.
  • the number monthly downloads has been multiplied by 10 during the year from 300 to 3,000.
  • Sonar has been given a heart called Squid that makes Sonar much more than an integration tool. Several metrics that do not exist elsewhere are calculated by Squid.
  • More than 4’000 emails exchanged on mailing lists and 1,000 Jira issues created.

So after all this, what could be an exciting challenge for 2010 ? We have set ourselves 2 very ambitious objectives for 2010 which should make the Sonar community continue growing :

  • Design analysis : we like to say that there are seven technical axes of code quality analysis (we call them the seven sins of the developer). Sonar currently covers sixth of them and the last one is for us the most important one with unit tests : Design & Architecture. Sonar 2.0 planned for February will start covering the 7th axis with O.O. metrics like LCOM4, RFC, DIT … cycles detection and DSM at package and class levels. All those information will be of course provided by Squid. Moreover, an architecture rule engine should quickly appear after Sonar 2.0.
  • Multi-languages : last but not least, give a real go at other languages. By the end of the year, we expect that plugins are available to cover properly : Java, PL/SQL, Flex, C/C++, Cobol, PHP and maybe more :-)

Here is a part of the program for 2010. I have now to leave you to start working on this as I think I will not have much spare time this year !

Create a plugin to compute custom metrics in Sonar

There was recently a very good article on the blog of Zauber, a company that creates software in Buenos Aires, Argentina. Mariano has written about his experience of developing a Sonar plugin for internal needs. He goes from a very high level view on the API to some implementation details. I recommend this article in case you want to build a plugin yourself : Zauber Code: Creating a Sonar Plugin for software development metrics

Page 1 of 3123

© 2008-2013, SonarSource S.A, Switzerland. All content is copyright protected. SONARQUBE and SONARSOURCE are
trademarks of SonarSource SA. All other trademarks and copyrights are the property of their respective owners. All rights are expressly reserved.