Static analysis metrics for analyzing UML model

You can collect 19 different types of information about a UML model. For example, you can discover the number of diagrams, the number of classes in a package, or the depth of a classifier in its inheritance hierarchy. UML metrics are grouped into four categories: coupling, diagrams, inheritance, and size.

Coupling metrics

The following table lists the metrics in the coupling category:
Metrics name Description
Number of classifiers which this classifier references by inheritance, dependency, attributes and operation parameters This metric counts the number of classifiers that a classifier references. In other words, this metric measures the efferent coupling. During the analysis, the following outgoing relationships are examined: inheritance, dependency, attributes, and operation parameters. The parent nodes show the average of the results for the child nodes.
Number of times this classifier is referenced by inheritance, dependency, attributes and operation parameters This metric counts the number of classifiers that reference a classifier. In other words, this metric measures the afferent coupling. During the analysis, the following incoming relationships are examined: inheritance, dependency, attributes, and operation parameters. The parent nodes show the average of the results for the child nodes.

Diagram metrics

The following table lists the metrics available in the diagram category:
Metric name Description
Number of diagrams in a namespace This metric counts the number of diagrams in a namespace. The parent nodes show the sum of the results for the child nodes.
Number of edges in a diagram This metric counts the number of edges in a diagram. The parent nodes show the sum of the results for the child nodes.
Number of shapes in a diagram This metric counts the number of shapes in a diagram. The parent nodes show the sum of the results for the child nodes.

Inheritance metrics

The following table lists the metrics available in the inheritance category:
Metric name Description
Number of ancestors of a classifier This metric counts the classifiers that a classifier specializes. The parent nodes show the average of the results for the child nodes.
Number of descendants of a classifier This metric counts the classifiers that a classifier generalizes. The parent nodes show the average of the results for the child nodes.
Depth of a classifier in its inheritance hierarchy This metric counts the depth of a classifier in its inheritance hierarchy; that is, the number of generalizations in the deepest inheritance branch. The parent nodes show the average of the results for the child nodes.
Number of attributes a classifier inherits This metric counts the number of attributes in the generalization classifiers of a classifier that the classifier does not override. The parent nodes show the average of the results for the child nodes.
Number of operations a classifier inherits This metric counts the number of operations in the generalization classifiers of a classifier that the classifier does not override. The parent nodes show the average of the results for the child nodes.
Number of attributes a classifier overrides This metric counts the number of attributes in the generalization classifiers of a classifier that the classifier overrides. The parent nodes show the average of the results for the child nodes.
Number of operations a classifier overrides This metric counts the number of attributes in the generalization classifiers of a classifier that the classifier overrides. The parent nodes show the average of the results for the child nodes.
Number of interfaces a class implements This metric counts the number of interfaces that a class implements. The parent nodes show the sum of the results for the child nodes.

Size metrics

The following table lists the metrics available in the size category:
Metric name Description
Number of attributes in a classifier This metric counts the number of attributes that a classifier defines, but does not include inherited attributes. The parent nodes show the average of the results for the child nodes.
Number of operations in a classifier This metric counts the number of operations that a classifier defines, but does not include inherited operations. The parent nodes show the average of the results for the child nodes.
Number of operations in a classifier with a name starting with "set" This metric counts the number of setters that a classifier defines, but does not include inherited setters. A setter is a method that sets the value of a property that a classifier defines. The name of a setter method begins with the prefix set. The parent nodes show the average of the results for the child nodes.
Number of operations in a classifier with a name starting with "get", "is" or "has" This metric counts the number of getters that a classifier defines, but does not include inherited getters. A getter is a method that returns the value of a property that a classifier defines. The name of a getter method either begins with the prefix get, which returns a non-Boolean value of a property; is, which returns a Boolean property; or has, which indicates that a property that is a collection of items contains a certain value. The parent nodes show the average of the results for the child nodes.
Number of classifiers in a package This metric counts the number of classifiers in a package. The parent nodes show the sum of the results for the child nodes.
Number of parameters in an operation This metric counts the number of parameters that an operation has. The parent nodes show the average of the results for the child nodes.

Feedback