Skip to main content
Log in

Refactoring object constraint language specifications

  • Special Issue Paper
  • Published:
Software & Systems Modeling Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. 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

    Google Scholar 

  2. 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

    Google Scholar 

  3. Beck, K.: Extreme Programming Explained. Addison-Wesley, Reading(2000)

  4. Beck, K., Gamma, E.: JUnit Open-Source Testing http://www.junit.org

  5. Borland Software Corporation, ModelRun tool. http://www.borland.com

  6. 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)

  7. 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)

  8. 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

    Google Scholar 

  9. 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

    Google Scholar 

  10. Date, C.J.: What Not How: The Business Rules Approach to Application Development. Addison-Wesley, Reading (2000)

  11. D’Souza, D., Wills, A.: Objects, Components and Frameworks with UML: The Catalysis Approach. Addison-Wesley, Reading (1998)

  12. 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

    Google Scholar 

  13. Eriksson H., Penker M.(1998): Business Modeling with UML – Business Patterns at Work. Wiley, Newyork

    Google Scholar 

  14. 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

    Google Scholar 

  15. Fowler, M.: Refactoring  –  Improving the Design of Existing Code. Addison-Wesley, Reading (1999)

  16. 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,

  17. 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

    Google Scholar 

  18. 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

    Google Scholar 

  19. Griwswold W.G.(1991). Program Restructuring as an Aid to Software Maintenance. PhD Thesis, University of Washington

  20. Halle B.(2001): Business Rules Applied. Wiley, Newyork

    Google Scholar 

  21. 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)

  22. Jones C.B.(1989): Systematic Software Development Using VDM. Prentice-Hall, Englewood Cliffs

    Google Scholar 

  23. Kabira Technologies Inc: Kabira Action Semantics. http://www.kabira.com

  24. Kennedy Carter Ltd.: Action Specification Language (ASL). http://www.kc.com

  25. Lieberherr K., Holland I.(1989): Formulations and benefits of the law of demeter. In: SIGPLAN Notices 24(3): 67–78

  26. Liu S.(2004): Formal Engineering for Industrial Software Development – Using the SOFL Method. Springer, Berlin Heidelberg Newyork

    Google Scholar 

  27. 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

  28. OMG: Model Driven Architecture (MDA), Object Management Group, document ormsc/2001-07-01, (2001)

  29. OMG: Request for Proposal: MOF 2.0 query/views/transformations RFP. Object Managament Group, document ad/02/04/10 (2002)

  30. OMG: UML 2.0 OCL Specification, Object Management Group, document ptc/03-10-14 (2003)

  31. OMG: Unified Modeling Language (UML), version 1.5, Object Management Group, document formal/2003-03-01 March (2003)

  32. OMG: Unified Modeling Language (UML) Infrastructure Specification, version 2.0, Object Management Group, ptc/03-09-15 (2003)

  33. OMG: Unified Modeling Language (UML) Superstructure Specification, version 2.0, Object Management Group, ptc/03-08-02, (2003)

  34. OMG: XML Metadata Interchange (XMI) Specification Version 1.2, Object Management Group, document formal/2002-01-01 (2002)

  35. Opdyke, W.F.: Refactoring: A Program Restructuring Aid in Designing Object-Oriented Application Frameworks. PhD Thesis, University of Illinois at Urbana-Champaign (1992)

  36. 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

    Google Scholar 

  37. Project Technology Inc.: BridgePoint Action Language (AL). http://www.projtech.com

  38. 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)

  39. Roberts, D.B.: Practical Analysis for Refactoring. PhD Thesis, University of Illnois at Urbana-Champaign (1999)

  40. Sendall, S.: Specifying Reactive System Behavior. PhD Thesis, Swiss Federal Institute of Technology in Lausanne, School of Computer and Communication Sciences (2002)

  41. 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

  42. oval, A., Requena, V., Fernández, J.L.: Emerging OCL Tools. J Softw Syst Model 2, 248–261 Springer, Berlin Heidelberg Newyork (2003)

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

  44. Woodcock J., Davis J.(1996): Using Z. Specification, Refinement and Proof. Prentice Hall, Englewood Chiffs

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Alexandre Correa.

Additional information

Ana Moreira and Thomas Baar

Rights and permissions

Reprints 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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10270-006-0023-y

Keywords

Navigation