This topic explains how you can create new rule categories, as well as modify rule categories, rule IDs, names, and severity levels using rule mappings. This is especially helpful if you want to configure SOAtest to enforce your team’s or organization’s coding policy (for example, by customizing the built-in rule names, severities, and categories to match the ones defined in your policy).
Sections include:
Specifying Rule Mappings
To specify rule mappings:
- Open the Test Configurations dialog by going to Parasoft > Test Configurations.
- Select any Test Configurations category.
- Open the Static > Rules Tree tab.
- Click Edit Rulemap.
- Enter your rule mapping in the Edit Rulemap File dialog that opens.
- To change the rule ID, name, and/or severity level: Add an entry to the Rules tab. A map entry defines a rule map which can change the specified built-in rule’s category ID, name, and/or severity level. Enter the current rule ID (for instance, SECURITY.RULENAME) in the Original ID column, then enter the desired changes in the appropriate column.
- If you want to change the rule ID, enter the desired rule ID in the Mapped ID column.
- If you want to change the severity, select it from the Severity column dropdown menu.
- If you want to change the rule name, enter the desired name in the Header column.
- To copy a rule to another rule ID and/or severity level: Add an entry to the Clones tab. Cloning rules is useful for mapping a single rule instance to multiple rule IDs. Enter the current rule ID (for instance, SECURITY.RULENAME) in the Original ID column, then enter the desired clone rule ID (for instance, SECURITY.RULE1) in the Clone ID column and/or select the desired clone severity level from the Severity column drop down menu.
- To add a new rule category: Add an entry to the Categories tab. Enter a new category ID in the Category ID column, then enter a brief category description in the Category Description column.
- To change the rule ID, name, and/or severity level: Add an entry to the Rules tab. A map entry defines a rule map which can change the specified built-in rule’s category ID, name, and/or severity level. Enter the current rule ID (for instance, SECURITY.RULENAME) in the Original ID column, then enter the desired changes in the appropriate column.
After you enter rule mappings in the SOAtest UI, they are saved in a simple text file named rulemap.xml
in your SOAtest installation directory.
Sharing Rule Mappings
You can share rule mappings by exporting/importing them.
To export rule mappings:
- Open the Rulemap dialog by clicking Edit Rulemap in the Static > Rule Tree tab of the Test Configuration panel.
- Click Export and choose where you want to save the rulemap file.
To import a rule mappings:
- Open the Rulemap dialog by clicking Edit Rulemap in the Static > Rule Tree tab of the Test Configuration panel.
- Click Import and choose the appropriate rulemap file.