Enhancing the Understandability of OCL Specifications

  • Alexandre Correa UFRJ
  • Cláudia Werner UFRJ
  • Márcio Barros UNIRIO

Abstract


OCL (Object Constraint Language) is the OMG standard language for the precise specification of constraints associated to MOF-compliant models and meta-models. Although OCL has been created with the intention to be a simpler language when compared to traditional formal specification languages, it is common to find specifications containing OCL constraints that are difficult to understand and evolve. This paper presents a set of potential problematic constructions often found in specifications written in OCL and a set of refactorings that can be applied to remove them. We also present an experimental study that has been performed to evaluate the effects of applying those strategies on the understandability of OCL specifications.

References

Ambler, S.W. (2002), “Toward Executable UML”, In: Software Development Magazine, January 2002 – http://www.sdmagazine.com.

Baar, T., Chiorean, D., Correa, A. et al (2005), "Tool Support for OCL and Related Formalisms Needs and Trends". In: Satellite Events at the MoDELS'2005 Conference Selected Papers, LNCS, v. 3844, pages 1-9, Montego Bay, Jamaica.

Berry, D. M., Kamsties, E. (2004), "Ambiguity in Requirements Specification". In Leite, J. C. S. P. and Doorn, J. H. (eds), Perspectives On Software Requirements, chapter 2, Kluwer Academic Publishers.

Boger, M., Sturm, T., Fragemann, P. (2002), “Refactoring Browser for UML”. In: International Conference on XP and Flexible Processes in Software Engineering, pages 77-81, Alghero, Italy.

Briand, L.C., Labiche, Y., Penta, M. et al (2005), “An Experimental Investigation of Formality in UML-Based Development”, In: IEEE Transactions on Software Engineering 31(10), pages 833-849.

Chiorean, D., Bortes, M., Corutiu, D., Sparleanu, R. (2004), “UML/OCL Tools – Objectives, Requirements, State of the Art: The OCLE Experience”. In: Proceedings of the 11th Nordic Workshop on Programming and Software Development Tools and Techniques”, pages 163-180, Turku, Finland.

Correa, A. (2006), “Refactoring OCL Model Constraints Specifications”, Doctoral Thesis – COPPE/UFRJ, In Portuguese.

Correa, A., Werner, C. (2004), “Applying Refactoring Techniques to UML/OCL Models”. In: Baar, T., Moreira, A., Strohmeier, A., Mellor, S. (eds.) <<UML>> 2004 – The UML: Modeling Languages and Applications. 7th International Conference, LNCS, vol. 3273, Springer, pages 173-187, Lisbon, Portugal.

Correa, A., Werner, C. (2006), “Odyssey-PSW: Uma Ferramenta de Apoio à Verificação e Validação de Especificações de Restrições OCL”. In: XX Simpósio Brasileiro de Engenharia de Software – Tool Session, Florianópolis, Brazil, In Portuguese.

Engels, G., Heckel, R., Küster, J.M., Groenewegen, L. (2002), “Consistency-preserving Model Evolution Through Transformations”. In: <<UML>> 2002 – The Unified Modeling Language: Model Engineering, Concepts and Tools. Proceedings of the 5th International Conference, LNCS, vol. 2460, pages 212-226, Dresden, Germany.

Finney, K., Fenton, N., Fedorec, A. (1999), “Effects of structure on the comprehensibility of formal specifications”, In: IEE Proceedings – Software 146(4), pages 193-202.

Fowler, M. (1999), “Refactoring – Improving the Design of Existing Code”. Addison-Wesley.

Gheyi, R., Massoni, T., Borba, P. (2005), “A Rigorous Approach for Providing Model Refactorings”. In: 20th IEEE/ACM International Conference on Automated Software Engineering (ASE), pages 372-375, Long Beach, USA.

Jones, C. B. (1989), “Systematic Software Development Using VDM”. Prentice-Hall. Kataoka, Y., Imai, T., Andou, H., Fukaya, T. (2002), “A Quantitative Evaluation of Maintainability Enhancement by Refactoring”. In: Proceedings of the International Conference on Software Maintainance (ICSM), pages 576-585, Montreal, Canada.

Markovic, S. and Baar, T. (2005), “Refactoring OCL annotated UML class diagrams”. In: “Model Driven Engineering Languages and Systems, 8th International Conference, MoDELS 2005”, LNCS, vol. 3713, pages 280-294, Montego Bay, Jamaica.

Massoni, T., Gheyi, R., Borba, P. (2005), “Formal Refactoring for UML Class Diagrams”. In: “XIX Simpósio Brasileiro de Engenharia de Software”, pages 152167, Uberlândia, Brazil.

Mens, T., Demeyer, S., Janssens, D. (2002), “Formalising behaviour preserving program transformations”. In: “Proceedings of the ICGT 2002 First International Conference on Graph Transformation”, LNCS, vol. 2505, Barcelona, Spain.

Mens, T., Tourwe, T. (2004), “A Survey of Software Refactoring”. In: IEEE Transactions on Software Engineering, 30(2), pages 126-139.

OMG – Object Management Group (2003a), “UML 2.0 OCL Specification”, http://www.omg.org/cgi-bin/doc?ptc/2003-10-14.

OMG – Object Management Group (2003b), “Model Driven Architecture (MDA) Guide” document number omg/2003-06-01.

OMG – Object Management Group (2005a), “MOF QVT Final Adopted Specification” document ptc/05-11-01.

OMG – Object Management Group (2005b), "Object Management Group Unified Modeling Language (UML) Superstructure Specification, version 2.0" http://www.omg.org/cgibin/doc?formal/05-07-04.

OMG – Object Management Group (1999), "Object Management Group Unified Modeling Language (UML) 1.3 specification" http://www.omg.org/cgibin/doc?formal/00-03-01.

Snook, C.F., Harrison, R. (2001), “Experimental Comparison of the Comprehensibility of a Z Specification and its Implementation”. In: Proceedings of the Conference on Empirical Assessment in Software Engineering – EASE 01, Keele University, England.

Sunyé, G., Pollet, D., Letraon, Y., et al (2001), "Refactoring UML models". In: <<UML 2001>> The UML: Modeling Languages, Concepts and Tools. 4th International Conference, LNCS, v. 2185, pages 134-148, Toronto, Canada.

Vaziri, M., Jackson, D. (2002), "Some Shortcomings of OCL, the Object Constraint Language of UML". In: Proceedings of the Technology of Object Oriented Languages and Systems Conference (TOOLS USA 34), pages 555-562, Santa Barbara, California, USA.

Warmer, J., Kleppe, A. (2003), “The Object Constraint Language – Getting Your Models Ready for MDA”. Addison-Wesley.

Wohlin, C., Runeson, P., Höst, M, et al (2000), “Experimentation in Software Engineering: An Introduction”, Kluver Academic Publishers.

Woodcock, J., Davis, J. (1996), “Using Z. Specification, Refinement and Proof”. Prentice Hall.
Published
2007-10-15
CORREA, Alexandre; WERNER, Cláudia; BARROS, Márcio. Enhancing the Understandability of OCL Specifications. In: BRAZILIAN SYMPOSIUM ON SOFTWARE ENGINEERING (SBES), 21. , 2007, João Pessoa. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2007 . p. 22-38. ISSN 2833-0633. DOI: https://doi.org/10.5753/sbes.2007.21297.