Measuring UML models
By Freddy Allilaire (INRIA), Rémi Schnekenburger (CEA LIST)
May 2007
This use case shows how to use and integrate a model transformation service in a UML Modeler to compute and generate quality measures on UML models.
Keywords
UML Modeler, UML 2, Measures.
Overview
This use case presents how the Papyrus UML Modeler could be used to compute and generate quality measures on UML models. Papyrus is a dedicated tool for UML2 graphical modelling developed mainly by CEA LIST. This open source tool is based on the Eclipse environment.
The figure below presents an example of UML Class Diagram made with Papyrus. Measures will be generated and computed on this working example:
The generation of measures on a UML model allows to perform several investigations. For example measuring the various models may bring interesting insight into the consideration of these models. Furthermore comparing similar measures applied to models of various origins may bring interesting observations.
From a UML Class Diagram, the following measures are available and will be computed when the ATL service “Generate Measures” will be executed:
-
Total Number of Packages: TNP is the total number of packages in the model.
-
Total Number of Classes: TNC is the total number of classes in a package or the model.
-
Total Number of Attributes: TNA is the total number of attributes in a class, package or the model.
-
Depth Inheritance Tree: In cases involving multiple inheritances, the DIT will be the maximum length from the node to the root of the tree.
-
Number of Children: NOC is the number of immediate subclasses subordinated to a class in the class hierarchy.
-
Number of Attributes: NA is defined as the total number of attributes in a class.
-
Number of Attributes Inherited: NAI is defined as the total number of attributes inherited by a subclass.
-
Attribute Inheritance Factor: The Attribute Inheritance Factor (AIF) is defined as a quotient between the sum of inherited attributes in all classes of the system under consideration and the total number of available attributes (locally defined plus inherited) for all classes.
Others and more complex measures could be easily added and implemented by modifying the corresponding ATL transformation. To see how to configure and run the “Measuring UML models” ATL service, please take a look to the User Guide.
The computed metrics will be displayed in 3 different representations: Tabular HTML, SVG Bar Chart, and SVG Pie Chart. The figures below present the sample results generated from our working example:
- Tabular HTML
- SVG Bar Chart
- SVG Pie Chart
Related Use Cases
None at the current time.
References
- Hoare, C.A.R Monitors: An Operating System Structuring Concept Communications of the ACM, Vol. 17, No. 10. October 1974, pp. 549-557
- Dijkstra, E. W. Cooperating Sequential Processes. In programming Languages (Ed. F. Genuys), Academic Press, New York.
Download
Acknowledgement
The present work is being supported by the Usine Logicielle project of the System@tic Paris Region Cluster.