8

There exist tools for comparing code against a custom specified set of coding guidelines/standards for a variety of languages (rather than pure static analysis for common defects). Examples include FxCop for .Net code and CheckStyle for Java, but I was wondering what examples people know of in the C++ world.

An existing question was asked regarding free tools which provided examples like Vera but I was also wondering about commercial tools that may be available.

Community
  • 1
  • 1
dlanod
  • 8,664
  • 8
  • 54
  • 96

6 Answers6

5

The full list that I managed to generate:

The last two provide some functionality but not particularly customisable ones:

dlanod
  • 8,664
  • 8
  • 54
  • 96
5

A tool used by us was CodeWizard from Parasoft. But I think the new version is called "Parasoft C++ Test". From the homepage:

  • Static analysis of code for compliance with user-selected coding standards
  • Graphical RuleWizard editor for creating custom coding rules
  • Static code path simulation for identifying potential runtime errors
  • Automated code review with a graphical interface and progress tracking
  • Automated generation and execution of unit and component-level tests
  • Flexible stub framework
  • Full support for regression testing
  • Code coverage analysis with code highlighting
  • Runtime memory error checking during unit test execution
  • Full team deployment infrastructure for desktop and command line usage
BtD
  • 95
  • 2
  • 10
4

DISCLAIMER: Working on this tool is my day job.

I'm obviously biased, but one of the main features of QA C++ is Coding Standard enforcement. For example we do JSF++ and MISRA C++ enforcement. You can read more about this here.

Richard Corden
  • 21,389
  • 8
  • 58
  • 85
  • This answer is relevant, and I believe plugging your IP is acceptable when this is relevant to the question. See this question http://meta.stackexchange.com/questions/741/what-is-the-most-appropriate-way-to-promote-yourself-using-stackoverflow/756#756 some discussion on this point. – ConcernedOfTunbridgeWells Feb 17 '10 at 12:48
2

astyle is a common Unix tool that reformats source to a specified style. It supports most C-like languages. I know of no similar commercial tools.

greyfade
  • 24,948
  • 7
  • 64
  • 80
2

I was also wondering about commercial tools that may be available.

Visual Studio Team System Edition 2005/2008 does have some such stuff. They also have a facility to enforce a set of rules on a whole team. Check it out.

dirkgently
  • 108,024
  • 16
  • 131
  • 187
1

I do not know whether you looking for a tool with built-in rules or want to validate against your custom rules. If it is the second, you may find it useful to implement searches for undesirable patterns based on regexp. Depending on your needs, Metrix++ http://metrixplusplus.sourceforge.net/ may offer helpful framework.

Andrew
  • 2,055
  • 2
  • 20
  • 27