Frequently, organizations deploy automated static analysis tools to implement a certain internal coding policy. Such a policy typically originates as a document that formalizes the coding conventions and best practices, and has its own classification of issues and their severities.

In most cases, the cleanest implementation of a coding policy in a static analysis tool utilizes rule descriptions and IDs that are already contained in this document, since it has already been reviewed by the development groups. C/C++test provides simple facilities to customize rule IDs and names, as well as to create new rule categories, so that the actual deployed rules exactly match the contents of the coding policy document.

This mapping is done via a Rule Map file. The Rule Map file can be used and imported/exported locally, or deployed via the deprecated Team Server to the entire user team.

If you use test configurations stored on DTP, see the 'Rule Maps' section in the DTP User Guide for details about managing, customizing, and applying rule mapping.

Sections include:

Specifying Rule Mappings

To specify rule mappings:

  1. Open the Test Configurations dialog by choosing Parasoft> Test Configurations.
  2. Select any Test Configurations category.
  3. Open the Static> Rules Tree tab.
  4. Click Edit Rulemap.
  5. Enter your rule mapping in the Edit Rulemap File dialog that opens.

After you enter rule mappings in the UI,  they are saved in a simple text file named rulemap.xml in the "User Rule" directory that you specified in the Preferences panel (on the Parasoft> Configurations page).

Want to copy an existing rule to another rule ID and/or severity level?

Right-click the rule in the Rules tree, then choose Duplicate. A duplicate rule will be added to the Rules tree. You can then customize the duplicate rule as needed.

Sharing Rule Mappings

Through Team Server (Deprecated)

The features and functionality described in this section have been deprecated.

If you are using Team Server and you want team members to share the rule changes, you should upload the rulemap.xml file to the Team Server

To upload the file to Team Server:

If a machine has access to both a local rulemap.xml file and a team rulemap.xml file, the team file will take precedence over the local file.

Through Export/Import

Even if you do not have Team Server, you can share rule mappings by exporting/importing them.

To export rule mappings:

  1. Open the Rulemap dialog by clicking the Edit Rulemap button in the Static> Rule Tree tab of the Test Configuration panel.
  2. Click the Export button, then use the file chooser to indicate where you want to save the rulemap file.

To import a rule mappings:

  1. Open the Rulemap dialog by clicking the Edit Rulemap button in the Static> Rule Tree  tab of the Test Configuration panel.
  2. Click the Import button, then use the file chooser to select the appropriate rulemap file.