Defining custom metrics and rules for UML models by using templates

You can create custom UML metrics to collect on a UML model in addition to the metrics that are available by default. You can also create custom UML review rules to supplement the rules that are available by default. Two templates are available for creating custom UML metrics. Four templates are available for creating custom UML review rules. You can add custom rules and metrics to existing analysis configurations or to new analysis configurations.

About this task

To create custom metrics and rules for UML models by using templates:

Procedure

  1. Click Window > Preferences.
  2. Expand Software Analyzer and click Custom Rules and Categories.
  3. To add a custom category, complete the following steps:
    1. On the Custom Rules and Categories page, click Add Category.
    2. In the Add Custom Category window, on the Choose Parent Category Location page, either select Model metrics for UML or Model review for UML; then click Next.
    3. In the Name field, type a name for a category and click Finish. The new category is displayed in the Current Custom Categories list.
  4. To add a custom rule, complete the following steps:
    1. On the Custom Rules and Categories page, click Add Rule.
    2. In the Add Custom Rule window, on the Choose a parent category page, select a category under UML Model Review or UML Model Metrics; then click Next.
    3. On the Select Template page, select a template and click Next.
    4. On the Assign Template Values page, follow the instructions in the Description field to fill in the template values and click Finish. The new rule is displayed in the Current Custom Rules list.
  5. Optional: To export custom rules, click Export, type a name for the export file and click Save. The custom rules are saved in a file with .ccr as a file name extension.
  6. Optional: To import custom rules, click Import, browse to a file with .ccr as a file name extension, and click Open.
  7. Optional: To delete a custom category, complete the following steps:
    1. Ensure that the category does not contain any rules. To delete rules, in the Current Custom Rules list, select a rule from the category and click Delete Rule; then repeat this action for any remaining rules in that category.
    2. In the Current Custom Categories list, select the category to delete and click Delete Category.

Feedback