This topic explains how to check custom requirements or tailor existing rules to your unique needs by either modifying built-in static analysis rules or by creating your own static analysis rules.
Sections include:
Many rules are parameterized, meaning that you can customize the nature of the rules by modifying the available rule parameters. Many naming convention rules are parameterized so that you can specify the naming convention that you want to check. Other rules are parameterized so that you can control rule options such as the scope of checking or choose among different interpretations of the rule. Parameterized rules are marked with a special icon (a wizard hat with a radio button) in the Test Configurations dialog Static > Rules Tree tab:
If a rule is parameterized, its parameters are described in the rule’s description. To view a rule’s description, right-click the node that represents that rule and choose View Rule Documentation.
To edit a parameterized rule:
This section explains the general workflow for customizing existing rules and creating new rules with RuleWizard. See RuleWizard User Guide for details about RuleWizard capabilities and usage. |
RuleWizard (available in the Architect and Automation edition only) allows you to create custom static analysis rules. SOAtest can automatically enforce any valid rule created in RuleWizard. By creating and checking custom rules, teams can verify unique project and organizational requirements, as well as prevent their most common errors from recurring.
With RuleWizard, rules can be created graphically (by creating a flow-chart-like representation of the rule) or automatically (by providing code that demonstrates a sample rule violation). No coding or knowledge of the parser is required to write or modify a rule.
There are two ways to open RuleWizard:
The RuleWizard GUI will then open. The RuleWizard User's Guide contains information on how to modify, create, and enable custom rules. You can access it by going to Help > Help Contents or Parasoft > Help (depending on your installation) and opening the "SOAtest RuleWizard User’s Guide" book.
If you are using a Linux distribution that uses a Wayland display server, you might get display issues with the RuleWizard. We recommend changing it to X11. You can verify what display server your Linux distribution is using by:
You can change your display server to X11 by:
|
With SOAtest Architect Edition and Automation Edition, you can use RuleWizard to customize any rule marked with the following wizard hat + wizard wand icon in the Test Configuration panel’s rules tree:
We strongly recommend that you leave the SOAtest built-in rules intact; rather than modify the built-in rules, duplicate them and modify the duplicates.
To customize a built-in rule in RuleWizard:
The RuleWizard GUI will then open. The RuleWizard User's Guide (accessible by going to Help > Documentation in the RuleWizard GUI) contains information on how to modify and save custom rules. Be sure to save the rule after you modify it, then enable it as described in the Configuring Test Configurations and Rules for Policies or Using Custom Rules.
This procedure is the same across Parasoft Test family products. For details, see the Configuring Test Configurations and Rules for Policies.
You can easily create your own static analysis rules (or modify built-in rules) using the SOAtest RuleWizard module, a graphical rule creation and customization tool available in SOAtest (Architect edition) and SOAtest (Automation edition).
With RuleWizard, rules can be created graphically (by creating a flow-chart-like representation of the rule) or automatically (by providing code that demonstrates a sample rule violation). No coding or knowledge of the parser is required to write or modify a rule.
To open RuleWizard, go to Parasoft > Launch RuleWizard.
The RuleWizard GUI will then open. The RuleWizard User's Guide (accessible by going to Help > Documentation in the RuleWizard GUI) contains information on how to modify, create, and save custom rules.
Before you can check custom rules, you must configure SOAtest to import and check them. For details on how to configure SOAtest to recognize and check those rules, see the Configuring Test Configurations and Rules for Policies or Using Custom Rules.
Each rule that you import into the tool must have a unique rule ID. You should not import multiple rules that have the same rule ID. |
Before you can check custom coding rules that were designed in RuleWizard, you need to configure SOAtest to access and check those rules.
To configure SOAtest to import and check custom rules: