You can prepare and implement custom static analysis rules to support your organization's specific development policy. Custom rules are created with a separate tool called Parasoft Rule Wizard (not included with DTP; contact your Parasoft representative for information) and executed as part of a test configuration by a DTP Engine.

Custom rules can be stored in DTP, which enables you to view the custom rule in the test configuration administration page and enable/disable the rule for selected test configurations. The configurations stored in DTP can be ran by DTP Engines that are connected to the server, which ensures coding consistency. Also see Test Configurations.

In this chapter:

Creating Custom Rules

Refer to the Rule Wizard documentation for instructions on creating custom rules (not included with DTP; contact your Parasoft representative for information). Rule Wizard outputs custom rules in a .rule file. Documentation for the rule is also created in Rule Wizard.

Uploading Custom Rules to DTP

  1. Choose Administration> Report Center from the main menu and choose Engines> Test Configurations.
  2. Click the engine in the sidebar for which the rule is intended to be used (i.e., if the rule is for Java code, click DTP Engine for Java).
  3. Click the Static Analysis Rules - customization tab and click Select Files in the Custom Rules section.
  4. Locate the .rule file(s) you want to upload to DTP Server. Some rules created in Rule Wizard are complex, so the .rule file may be accompanied by an ext subfolder that contains an extension for the rule. You can compress the .rule file and extension folder into a .zip file and upload it to DTP. The .zip file will be decompressed and stored on the server.
  5. Click Upload to finish uploading the .rule(s) so that they can be used by the DTP Engine.
  6. Click the Static Analysis Rules tab locate the custom rule to view it. To locate your rule, you can use the search bar or enable the Custom option to filter by custom rules.

    If you added rule documentation when creating the rule, it will also appear.

Enabling Custom Rules

You can enable uploaded rules for test configurations used by the DTP Engine. See Static Analysis - Rules Tab for information on how to enable rules for a test configuration.

The DTP Engine must also be configured to use the updated test configuration (see the DTP Engine documentation).

In the DTP Engine .properties configuration file, enable the following setting to ensure that the engine can use the test configuration containing the custom rule(s):

dtp.share.enabled=true

This is property is required because custom rules are stored in Team Server in the main root data storage account for DTP server.

Enabling Custom Rules from a DTP Engine

You can also enable custom rules in DTP Engines without including DTP to your workflow. Refer to the DTP Engine documentation for instructions on how to define and use the custom rules in DTP Engines.


  • No labels