Monthly Archives: November 2011

Cppcheck – A free static analyser for C and C++

I got a tip from Anna-Jayne Metcalfe of C++ and QA specialists Riverblade to check out Cppcheck, a free static analyser for C and C++. I ran >100 kLOC of PerfectTablePlan C++ through it and it picked up a few issues, including:

  • variables uninitialised in constructors
  • classes passed by value, rather than as a const reference
  • variables whose scopes could be reduced
  • methods that could be made const

It only took me a few minutes from downloading to getting results. And the results are a lot less noisy than lint. I’m impressed. PerfectTablePlan is heavily tested and I don’t think any of the issues found are the cause of bugs in PerfectTablePlan, but it shows the potential of the tool.

The documentation is here. But, on Windows, you just need to start the Cppcheck GUI (in C:\Program files\Cppcheck, they appear to be too modest to add a shortcut to your desktop), select Check>Directory… and browse to the source directory you want to check. Any issues found will then be displayed.

You can also set an editor to integrate with, in Edit>Preferences>Applications. Double clicking on an issue will then display the appropriate line in your editor of choice.

Cppdepend is available with a GUI on Windows and as a command line tool on a range of platforms. There is also an Eclipse plugin. See the sourceforge page for details on platforms and IDEs supported. You can even write your own Cppcheck rules.

Cppcheck could be a very valuable additional layer in my defence in depth approach to QA. I have added it to my checklist of things to do before each new release.

ESWC 2011

No proper post this week. I’m too busy finishing off my talk ‘Promoting your software’ for ESWC 2011 in London next weekend (19-20 Nov). I am going to talk about my experiences attempting to try every form of promotion known to man including: SEO, Google Adwords, magazine ads, affiliates, Facebook ads and hanging out in wedding forums using a female pseudonym. With audience participation! Plus real data!

There are also some other interesting looking talks. Chatting to other people in the business over coffee or beer is also invaluable. If you haven’t booked a ticket, it isn’t too late. Don’t worry if it is your first time – people are very friendly. Do come and say hello.

On the subject of conferences, the ASP is putting on ISVCon in Reno, Nevada, USA in July 2012. Being UK based it is probably further than I am prepared to fly for a conference. But I hope it is a huge success.