Formal Refactoring for UML Class Diagrams

  • Tiago Massoni UFPE
  • Rohit Gheyi UFPE
  • Paulo Borba UFPE

Abstract


Refactoring UML models for evolution is usually carried out in an ad hoc way. These transformations can become an issue, since it is hard to ensure that the semantics of models is preserved. We provide a set of semantics-preserving transformations for UML class diagrams annotaded with OCL. Using the proposed transformations, software designers can safely define larger transformations and detect subtle problems when refactoring models. Semantics-preserving transformations can also be useful from design pattern introduction to MDA. We prove that our transformations are sound using a semantic model that is based on Alloy, which is a formal modeling language. Due to Alloy’s ammenability to automatic analysis, our approach may additionally bring such analysis to class diagrams.

Keywords: model refactoring, class diagram, OCL, Alloy

References

Bourdeau, R. and Cheng, B. (1995). A Formal Semantics for Object Model Diagrams. IEEE Transactions on Soft. Engineering, 21(10):799-821.

Dennis, G. et al. (2004). Automating Commutativity Analysis at the Design Level. In Inter. Symposium on Software Testing and Analysis, pages 165-174.

Edwards, J. et al. (2004). A Type System for Object Models. In 12th Foundations of Software Engineering, pages 189-199. ACM Press.

Evans, A. et al. (1999). The UML as a formal modeling notation. In UML'98 First International Workshop, pages 336-348. Springer.

Evans, A. S. (1998). Reasoning with UML Class Diagrams. In 2nd IEEE Workshop on Industrial Strength Formal Specification Techniques, pages 102-113. IEEE CS Press.

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

Gheyi, R., Massoni, T., and Borba, P. (2004). Basic laws of object modeling. In Third Specification and Verification of Component-Based Systems (SAVCBS), affiliated with ACM SIGSOFT 2004/FSE-12, pages 18-25, Newport Beach, United States.

Gheyi, R., Massoni, T., and Borba, P. (2005a). A Rigorous Approach for Proving Model Refactorings. Submitted for publication.

Gheyi, R., Massoni, T., and Borba, P. (2005b). An Abstract Equivalence Notion for Object Models. In A. Mota, A. M., editor, Electronic Notes in Theoretical Computer Science, volume 130, pages 3-21. Elsevier.

Gogolla, M. and Richters, M. (1998). Equivalence Rules for UML Class Diagrams. In UML'98 First International Workshop, pages 87-96.

Greenfield, J. et al. (2004). Software Factories: Assembling Applications with Patterns, Models, Frameworks, and Tools. Wiley.

Jackson, D. (2005). Alloy 3.0 Reference Manual. http://alloy.mit.edu/beta/reference-manual.pdf.

Jackson, D. et al. (2000). Alcoa: the Alloy Constraint Analyzer. In 22nd International Conference on Software Engineering, pages 730-733. ACM Press.

Jackson, D. et al. (2001). A Micromodularity Mechanism. In 9th Foundations of Software Engineering, pages 62-73. ACM Press.

Lano, K. and Bicarregui, J. (1998). Semantics and Transformations for UML Models. In UML'98 First International Workshop, pages 107-119.

Larman, C. (2001). Applying UML and Patterns: An Introduction to ObjectOriented Analysis and Design and the Unified Process. Prentice Hall.

Massoni, T., Gheyi, R., and Borba, P. (2004). A UML Class Diagram Analyzer. In 3rd International Workshop on Critical Systems Development with UML, affiliated with 7th UML Conference, pages 143-153.

Massoni, T., Gheyi, R., and Borba, P. (2005). A Model-driven Approach to Program Refactoring. Submitted for publication.

Object Management Group (2001). XMI specification.

Object Management Group (2003). Unified Modeling Language Specification Version 1.5.

Owre, S. et al. (2005). PVS language and prover reference. At http://pvs.csl.sri.com.

Porres, I. (2003). Model refactorings as rule-based update transformations. In 6th UML Conference, volume 2863 of LNCS, pages 159-174. Springer.

Sampaio, A. et al. (2003). Class and Capsule Refinement in UML for Real Time. In 6th Brazilian Workshop on Formal Methods, pages 16-34.

Soley, R. (2000). Model Driven Architecture. OMG Document 2000-11-05.

Sunyé, G. et al. (2001). Refactoring UML Models. In 4th UML Conference, volume 2185 of LNCS, pages 134-148. Springer.

Warmer, J. et al. (2003). The Object Constraint Language: Getting Your Models Ready for MDA. Addison Wesley, 2nd edition.
Published
2005-10-03
MASSONI, Tiago; GHEYI, Rohit; BORBA, Paulo. Formal Refactoring for UML Class Diagrams. In: BRAZILIAN SYMPOSIUM ON SOFTWARE ENGINEERING (SBES), 19. , 2005, Uberlândia/MG. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2005 . p. 152-167. ISSN 2833-0633. DOI: https://doi.org/10.5753/sbes.2005.23817.