On this page
The parameter definition of a Metric Suite can be specified:
- As an attribute with the «ParameterDefinition» stereotype.
- In the body of a metric definition.
If you need to track parameter values, the parameter definition should be specified as the attribute of a Metric Suite. In this case, each value of the parameter becomes the slot of an instance created when running the Metric Suite. If a Metric Suite is created using the BaseMetricSuite, it already has a few parameter definitions inherited through the Generalization relationship, such as scope and coveringScope. If you have created a Metric Suite from scratch or the inherited parameters don't meet your needs, you should specify your own parameter definitions.
To specify a parameter definition as the attribute of a Metric Suite
- Select the shape of a Metric Suite.
- Click the Create Element button on the right side of the shape and select Parameter definition. The attribute with the «ParamterDefinition» stereotype is created.
- Type its name directly on the shape, and then click a free space on the diagram.
- Select the attribute on the shape and click .
Select the type of the parameter.
This step is mandatory. A parameter must have a type.
The parameter definition is specified.
Instead of defining the parameters from scratch, you can copy them from the BaseMetricSuite and then modify according to your needs.
Declaring the context
One of the parameter definitions must be declared as the context of a Metric Suite. If a Metric Suite has the context declared, then any element, for which you select to calculate appropriate metrics, becomes the value of the context parameter definition of this Metric Suite and is used for calculating metrics. Otherwise, calculating metrics for the selected element makes no sense (unless the context is declared in the body of a metric definition).
Make sure the type of the parameter you are going to declare as the context is the same as the type of the target of a Metric Suite.
To declare the context for a Metric Suite
- On the shape of a Metric Suite, double-click the parameter you need to define as the context for the Metric Suite. The Specification window of the parameter opens.
- Set the Set As Context property value as true.
- Click the Close button.
The parameter is declared as the context of the Metric Suite.
If your Metric Suite is created using the BaseMetricSuite, it already has the context parameter definition - the scope.