Measuring UML Models Using Metrics Defined in OCL within the SQUAM Framework

  • Joanna Chimiak-Opoka
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6981)


In software engineering practice, measurements may reduce development costs by improving processes and products at early stages. In model driven approaches, measurements can be conducted right from the start of a project. For UML models, a collection of metrics has been empirically validated, however, these need to be precisely defined in order to be useful. Definition of UML metrics in OCL offers a high degree of precision and portability, but due to shortcomings of this language this approach is not widespread. We propose the SQUAM framework, a tool–supported methodology to develop OCL specifications, which incorporates best practices in software development, such as libraries, testing and documentation. As a proof of concept we have developed 26 metrics for UML class diagrams in the academic context. This demonstrated the high effectiveness of our approach: quick learning, high satisfaction of developers, low imposed complexity and potential time reduction through reuse.


model analysis UML metrics OCL specification OCL pragmatic extensions OCL development process 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Briand, L.C., Morasca, S., Basili, V.R.: An Operational Process for Goal-Driven Definition of Measures. IEEE Trans. Softw. Eng. 28, 1106–1125 (2002)CrossRefGoogle Scholar
  2. 2.
    Fuggetta, A., Lavazza, L., Morasca, S., Cinti, S., Oldano, G., Orazi, E.: Applying GQM in an Industrial Software Factory. ACM Trans. Softw. Eng. Methodol. 7, 411–448 (1998)CrossRefGoogle Scholar
  3. 3.
    Lanza, M., Marinescu, R., Ducasse, S.: Object-Oriented Metrics in Practice. Springer-Verlag New York, Inc., Secaucus (2005)Google Scholar
  4. 4.
    OMG: OMG Unified Modeling LanguageTM (OMG UML), Superstructure. version 2.2 (2009)
  5. 5.
    Genero, M., Piattini, M., Calero, C.: A survey of Metrics for UML Class Diagrams. Journal of Object Technology 4(9), 59–92 (2005), CrossRefGoogle Scholar
  6. 6.
    Seidl, R., Sneed, H.: Modeling Metrics for UML Diagrams. The Magazine for Professional Testers, 12–20 (September 2010),
  7. 7.
    Basili, V.R., Caldiera, G., Rombach, H.D.: The Goal Question Metric Approach. In: Encyclopedia of Software Engineering, pp. 528–532. John Wiley and Sons, Chichester (1994)Google Scholar
  8. 8.
    Misic, V.B., Moser, S.: From Formal Metamodels to Metrics: An Object-Oriented Approach. In: Marie, R., Plateau, B., Calzarossa, M.C., Rubino, G.J. (eds.) TOOLS 1997. LNCS, vol. 1245, pp. 330–339. Springer, Heidelberg (1997)Google Scholar
  9. 9.
    El-Wakil, M., El-Bastawisi, A., Riad, M., Fahmy, A.: A Novel Approach to Formalize Object-Oriented Design Metrics. In: Proc. Conf. Evaluation and Assessment in Software Eng., EASE 2005 (2005)Google Scholar
  10. 10.
    Harmer, T.J., Wilkie, F.G.: An Extensible Metrics Extraction Environment for Object-Oriented Programming Languages. In: Proc. of the Int. Conf. on Software Maintenance (2002)Google Scholar
  11. 11.
    OMG: Object Constraint Language. OMG Available Spec. Version 2.0 (May 2006),
  12. 12.
    Chimiak-Opoka, J., Felderer, M., Lenz, C., Lange, C.: Querying UML Models using OCL and Prolog: A Performance Study. In: Model Driven Engineering, Verification, and Validation, Lillehammer, Norway (April 2008) (presented at MoDeVVa)Google Scholar
  13. 13.
    Baroni, A.L., Braz, S., Abreu, F.B.E., Portugal, N.L.: Using OCL to Formalize Object-Oriented Design Metrics Definitions (July 15, 2002)Google Scholar
  14. 14.
    McQuillan, J.A., Power, J.F.: Towards the Re-usability of Software Metric Definitions at the Meta Level. In: PhD Workshop of the 20th European Conf. on Object-Oriented Programming (2006) (position paper)Google Scholar
  15. 15.
    McQuillan, J., Power, J.: A Definition of the Chidamber and Kemerer Metrics suite for UML. Technical report, National University of Ireland (2006)Google Scholar
  16. 16.
    Clavel, M., Egea, M., Silva, V.T.D.: Model Metrication in MOVA: A Metamodel-Based Approach using OCL (2007) (manuscript published on-line)Google Scholar
  17. 17.
    Ackermann, J.: Fallstudie zur Spezifikation von Fachkomponenten. In: Turowski, K. (ed.) Workshop Modellierung und Spezifikation von Fachkomponenten, Bamberg, Deutschland, pp. 1–66 (2001)Google Scholar
  18. 18.
    Vaziri, M., Jackson, D.: Some Shortcomings of OCL, the Object Constraint Language of UML. In: Li, Q., et al. (eds.) TOOLS (34), pp. 555–562. IEEE Computer Society, Los Alamitos (2000)Google Scholar
  19. 19.
    Correa, A.L., Werner, C., de Oliveira Barros, M.: An empirical study of the impact of OCL smells and refactorings on the understandability of OCL specifications. In: Engels, G., Opdyke, B., Schmidt, D.C., Weil, F. (eds.) MODELS 2007. LNCS, vol. 4735, pp. 76–90. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  20. 20.
    Moisan, S., Rigault, J.-P.: Teaching object-oriented modeling and UML to various audiences. In: Ghosh, S. (ed.) MODELS 2009. LNCS, vol. 6002, pp. 40–54. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  21. 21.
    Chimiak-Opoka, J., Demuth, B., Awenius, A., Chiorean, D., Gabel, S., Hamann, L., Willink, E.: Ocl tools report based on the ide4ocl feature model (2011) (presented at OCL Workshop, to appear in ECEASST)Google Scholar
  22. 22.
    Chimiak-Opoka, J.: OCLLib, OCLUnit, OCLDoc: Pragmatic Extensions for the Object Constraint Language. In: Schürr, A., Selic, B. (eds.) MODELS 2009. LNCS, vol. 5795, pp. 665–669. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  23. 23.
    Chimiak-Opoka, J., Agreiter, B., Breu, R.: Bringing Models into Practice: Design and Usage of UML Profiles and OCL Queries in a showcase. In: Targamadze, A., et al. (eds.) Proc. of the 16th Int. Conf. on Information and Software Technologies, IT 2010, Kaunas, Lithuania, Technologija, April 2010, pp. 265–273 (2010)Google Scholar
  24. 24.
    Li, W., Henry, S.: Object–Oriented Metrics that Predict Maintainability. Journal of Systems and Software 23(2), 111–122 (1993)CrossRefGoogle Scholar
  25. 25.
    Li, W.: Another Metric Suite for Object-Oriented Programming. J. Syst. Softw. 44, 155–162 (1998)CrossRefGoogle Scholar
  26. 26.
    Felderer, M., Chimiak-Opoka, J., Zech, P., Haisjackl, C., Fiedler, F., Breu, R.: Model Validation in a Tool–based Methodology for System Testing of Service–oriented Systems. Int. Journal On Advances in Software (to appear, 2011)Google Scholar
  27. 27.
    Arlow, J., Neustadt, I.: Secrets of Object Oriented Analysis. John Wiley & Sons, Inc., New York (2009)Google Scholar
  28. 28.
    OMG: Meta-Object Facility (MOF)—Spec. of version 2.0 (January 2006),

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Joanna Chimiak-Opoka
    • 1
  1. 1.Institute of Computer ScienceUniversity of InnsbruckAustria

Personalised recommendations