Abstract
The object constraint language (OCL) plays an important role in the elaboration of precise models. Although OCL was designed to be both formal and simple, OCL specifications may be difficult to understand and evolve, particularly those containing complex or duplicated expressions. In this paper, we discuss how refactoring techniques can be applied in order to improve the understandability and maintainability of OCL specifications. In particular, we present several potentially bad constructions often found in OCL specifications and a collection of refactorings that can be applied to replace such constructions by better ones. We also briefly discuss how refactorings can be automated and how model regression testing can be used to increase our confidence that the semantics of an OCL specification has been preserved after manually performed refactorings.
Similar content being viewed by others
References
Baresi L., Heckel R.(2002): Tutorial introduction to graph transformation: a software engineering perspective. In: Corradini A., Ehrig H., Kreowski H-J., Rozenberg G. (eds). Proceedings of the ICGT 2002 – First International Conference on Graph Transformation, LNCS, vol 2505. Springer, Barcelona
Bauerdick H., Gogolla M., Gutsche F.(2004): Detecting OCL Traps in the UML 2.0 superstructure: an experince report. In: Baar T., Moreira A., Strohmeier A., Mellor S. (eds). < < UML > > 2004 – The Unified Modeling Language: Modeling Languages and Applications. Springer, Lisbon, pp. 188–196
Beck, K.: Extreme Programming Explained. Addison-Wesley, Reading(2000)
Beck, K., Gamma, E.: JUnit Open-Source Testing http://www.junit.org
Borland Software Corporation, ModelRun tool. http://www.borland.com
Cariou, E., Marvie, R., Seinturier, L., Duchien, L.: OCL for the specification of model transformation Contracts. In: Proceedings of the UML 2004 Workshop: OCL and Model Driven Engineering, Lisbon, (2004)
Chiorean, D., Pasca, M., Carcu, A., Botiza, C, Moldovan, S.: Ensuring UML models consistency using the OCL environment. In: Proceedings of the UML 2003 Workshop: OCL2.0 – Industry Standard or Scientific Playground? San Francisco (2003)
Cook S., Kleppe A., Mitchell R., Rumpe B., Warmer J., Wills A.(2002): The Amsterdam manifesto on OCL. In: Clark T., Warmer J. (eds). Object Modeling with the OCL, LNCS, vol 2263. Springer, Berlin Heidelberg Newyork , pp. 115–149
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 Unified Modeling Language: Modeling Languages and Applications. Springer, Lisbon, pp. 173–187
Date, C.J.: What Not How: The Business Rules Approach to Application Development. Addison-Wesley, Reading (2000)
D’Souza, D., Wills, A.: Objects, Components and Frameworks with UML: The Catalysis Approach. Addison-Wesley, Reading (1998)
Engels G., Heckel R., Küster J.M., Groenewegen L. (2002): Consistency-preserving model evolution through transformations. In: Jézéquel J.M., Hussmann H., Cook S. (eds). < < UML > > 2002 – The Unified Modeling Language: Model Engineering, Concepts and Tools. Springer, Dresden, pp. 212–226
Eriksson H., Penker M.(1998): Business Modeling with UML – Business Patterns at Work. Wiley, Newyork
Fernandez-Medina E., Piattini M.(2004): Extending OCL for secure database development. In: Baar T., Moreira A., Strohmeier A., Mellor S. (eds). < < UML > > 2004 – The Unified Modeling Language: Modeling Languages and Applications. Springer, Lisbon, pp. 380–394
Fowler, M.: Refactoring – Improving the Design of Existing Code. Addison-Wesley, Reading (1999)
Gerber A., Lawley M., Raymond K., Steel J., Wood A. (2002): Transformation: the missing link of MDA. In: Corradini A., Ehrig H., Kreowski H-J., Rozenberg G.,(eds). Proceedings of the ICGT 2002 - 1st International Conference on Graph Transformation, LNCS, vol. 2505. Springer, Barcelona,
Gogolla M., Bohling J., Richters M. (2003): Validation of UML and OCL models by automatic snapshot generation. In: Stevens P., Whittle J., Booch G. (eds). < < UML > > 2003 – The Modeling Language: Modeling Languages and Applications. Springer, San Francisco, pp. 265–279
Gorp P.V., Stenten H., Mens T., Demeyer S.(2003): Towards automating source-consistent UML refactorings. In: Stevens P., Whittle J., Booch G. (eds). < < UML > > 2003 – The Unified Modeling Language: Modeling Languages and Applications. Springer, San Francisco, pp. 144–158
Griwswold W.G.(1991). Program Restructuring as an Aid to Software Maintenance. PhD Thesis, University of Washington
Halle B.(2001): Business Rules Applied. Wiley, Newyork
Haustein, S., Pleumann, J.: OCL as expression language in an action semantics surface language. In: Proceedings of the UML 2004 Workshop: OCL and Model Driven Engineering, Lisbon (2004)
Jones C.B.(1989): Systematic Software Development Using VDM. Prentice-Hall, Englewood Cliffs
Kabira Technologies Inc: Kabira Action Semantics. http://www.kabira.com
Kennedy Carter Ltd.: Action Specification Language (ASL). http://www.kc.com
Lieberherr K., Holland I.(1989): Formulations and benefits of the law of demeter. In: SIGPLAN Notices 24(3): 67–78
Liu S.(2004): Formal Engineering for Industrial Software Development – Using the SOFL Method. Springer, Berlin Heidelberg Newyork
Mens T., Demeyer S., Janssens D.(2002): Formalising behaviour preserving program transformations. In: Corradini A., Ehrig H., Kreowski H-J., Rozenberg G., (eds). Proceedings of the ICGT 2002 – First International Conference on Graph transformation, LNCS, vol. 2505. Springer, Barcelona
OMG: Model Driven Architecture (MDA), Object Management Group, document ormsc/2001-07-01, (2001)
OMG: Request for Proposal: MOF 2.0 query/views/transformations RFP. Object Managament Group, document ad/02/04/10 (2002)
OMG: UML 2.0 OCL Specification, Object Management Group, document ptc/03-10-14 (2003)
OMG: Unified Modeling Language (UML), version 1.5, Object Management Group, document formal/2003-03-01 March (2003)
OMG: Unified Modeling Language (UML) Infrastructure Specification, version 2.0, Object Management Group, ptc/03-09-15 (2003)
OMG: Unified Modeling Language (UML) Superstructure Specification, version 2.0, Object Management Group, ptc/03-08-02, (2003)
OMG: XML Metadata Interchange (XMI) Specification Version 1.2, Object Management Group, document formal/2002-01-01 (2002)
Opdyke, W.F.: Refactoring: A Program Restructuring Aid in Designing Object-Oriented Application Frameworks. PhD Thesis, University of Illinois at Urbana-Champaign (1992)
Porres I.(2003): Model refactorings as rule-based update transformations. In: Stevens P., Whittle J., Booch G. (eds). < < UML > > 2003 – The Unified Modeling Language: Modeling Languages and Applications. Springer, San Francisco, pp. 159–174
Project Technology Inc.: BridgePoint Action Language (AL). http://www.projtech.com
Richters, M., Gogolla, M.: Validating UML Models and OCL Constraints. In: Evans, A., Kent, S., (eds) < < UML 2000 > > Procedings of the 3rd International Conference on the Unified Modeling Language, LNCS, vol. 1939, pp. 266–277 Springer, York (2000)
Roberts, D.B.: Practical Analysis for Refactoring. PhD Thesis, University of Illnois at Urbana-Champaign (1999)
Sendall, S.: Specifying Reactive System Behavior. PhD Thesis, Swiss Federal Institute of Technology in Lausanne, School of Computer and Communication Sciences (2002)
Sunyé G., Pollet D., Le Traon Y., Jézéquel J.M.(2001): Refactoring UML models. In: < < UML 2001 > > The Unified Modeling Language: Modeling Languages, Concepts and Tools. Proceedings of the 4th International Conference, LNCS, vol. 2185,. pp. 134–148 Springer, Toronto
oval, A., Requena, V., Fernández, J.L.: Emerging OCL Tools. J Softw Syst Model 2, 248–261 Springer, Berlin Heidelberg Newyork (2003)
Warmer, J., Kleppe, A.: The Object Constraint Language – Getting Your Models Ready for MDA. Addison- Wesley, Reading (2003)
Woodcock J., Davis J.(1996): Using Z. Specification, Refinement and Proof. Prentice Hall, Englewood Chiffs
Author information
Authors and Affiliations
Corresponding author
Additional information
Ana Moreira and Thomas Baar
Rights and permissions
About this article
Cite this article
Correa, A., Werner, C. Refactoring object constraint language specifications. Softw Syst Model 6, 113–138 (2007). https://doi.org/10.1007/s10270-006-0023-y
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10270-006-0023-y