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 a generalization relationship, such as scope and coveringScope. If you 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


  1. Select the shape of a metric suite.
  2. Click the Create Element button on the right side of the shape and select Parameter definition. The attribute with the «ParamterDefinition» stereotype is created.



  3. Type its name directly on the shape, and then click a free space on the diagram.
  4. Select the attribute on the shape and click .
  5. 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


  1. 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.
  2. Set the Set As Context property value as true.
  3. 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.