Skip to main content

Optimising OCL Synthesized Code

  • Conference paper
  • First Online:
Modelling Foundations and Applications (ECMFA 2018)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 10890))

Included in the following conference series:

Abstract

OCL is a important element of many Model-Driven Engineering tools, used for different purposes like writing integrity constraints, as navigation language in model transformation languages or to define transformation specifications. There are refactorings approaches for manually written OCL code, but there is not any tool for the simplification of OCL expressions which have been automatically synthesized (e.g., by a repair system). These generated expressions tend to be complex and unreadable due to the nature of the generative process. However, to be useful this code should be as simple and resemble manually written code as much as possible.

In this work we contribute a set of refactorings intended to optimise OCL expressions, notably covering cases likely to arise in generated OCL code. We also contribute the implementation of these refactorings, built as a generic transformation component using bentō, a transformation reuse tool for ATL, so that it is possible to specialise the component for any OCL variant based on Ecore. We describe the design and implementation of the component and evaluate it by simplifying a large amount of OCL expressions generated automatically showing promising results. Moreover, we derive implementations for ATL, EMF/OCL and SimpleOCL.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    http://github.com/jesusc/bento.

  2. 2.

    http://anatlyzer.github.io.

  3. 3.

    http://github.com/jesusc/beautyocl.

  4. 4.

    http://www.eclipse.org/atl/atlTransformations/.

References

  1. Ackermann, J., Turowski, K.: A library of OCL specification patterns for behavioral specification of software components. In: Dubois, E., Pohl, K. (eds.) CAiSE 2006. LNCS, vol. 4001, pp. 255–269. Springer, Heidelberg (2006). https://doi.org/10.1007/11767138_18

    Chapter  Google Scholar 

  2. Arendt, T., Biermann, E., Jurack, S., Krause, C., Taentzer, G.: Henshin: advanced concepts and tools for in-place EMF model transformations. In: Petriu, D.C., Rouquette, N., Haugen, Ø. (eds.) MODELS 2010. LNCS, vol. 6394, pp. 121–135. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-16145-2_9

    Chapter  Google Scholar 

  3. Bracha, G., Ungar, D.: OOPSLA 2004: mirrors: design principles for meta-level facilities of object-oriented programming languages. ACM SIGPLAN Not. 50(8), 35–48 (2015)

    Article  Google Scholar 

  4. Bravenboer, M., Kalleberg, K.T., Vermaas, R., Visser, E.: Stratego/XT 0.17. A language and toolset for program transformation. Sci. Comput. Program. 72(1–2), 52–70 (2008)

    Article  MathSciNet  Google Scholar 

  5. Cabot, J., Teniente, E.: Transformation techniques for OCL constraints. Sci. Comput. Program. 68(3), 179–195 (2007)

    Article  MathSciNet  Google Scholar 

  6. Correa, A., Werner, C.: Refactoring object constraint language specifications. Softw. Syst. Model. 6(2), 113–138 (2007)

    Article  Google Scholar 

  7. Correa, A., Werner, C., 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). https://doi.org/10.1007/978-3-540-75209-7_6

    Chapter  Google Scholar 

  8. Cuadrado, J.S., Guerra, E., de Lara, J.: A component model for model transformations. IEEE Trans. Softw. Eng. 40(11), 1042–1060 (2014)

    Article  Google Scholar 

  9. Sánchez Cuadrado, J., Guerra, E., de Lara, J.: Reverse engineering of model transformations for reusability. In: Di Ruscio, D., Varró, D. (eds.) ICMT 2014. LNCS, vol. 8568, pp. 186–201. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-08789-4_14

    Chapter  Google Scholar 

  10. Cuadrado, J.S., Guerra, E., de Lara, J.: Reusable model transformation components with bentō. In: Kolovos, D., Wimmer, M. (eds.) ICMT 2015. LNCS, vol. 9152, pp. 59–65. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21155-8_5

    Chapter  Google Scholar 

  11. Cuadrado, J.S., Guerra, E., de Lara, J.: Quick fixing ATL transformations with speculative analysis. Softw. Syst. Model. 1–35 (2016)

    Google Scholar 

  12. Cuadrado, J.S., Guerra, E., de Lara, J.: Static analysis of model transformations. IEEE Trans. Softw. Eng. 43(9), 868–897 (2017)

    Article  Google Scholar 

  13. Cuadrado, J.S., Guerra, E., de Lara, J.: AnATLyzer: an advanced IDE for ATL model transformations. In: 40th International Conference on Software Engineering (ICSE). ACM/IEEE (2018)

    Google Scholar 

  14. Cuadrado, J.S., Guerra, E., de Lara, J., Clarisó, R., Cabot, J.: Translating target to source constraints in model-to-model transformations. In: 2017 ACM/IEEE 20th International Conference on Model Driven Engineering Languages and Systems (MODELS), pp. 12–22. IEEE (2017)

    Google Scholar 

  15. Sánchez Cuadrado, J., Jouault, F., García Molina, J., Bézivin, J.: Optimization patterns for OCL-based model transformations. In: Chaudron, M.R.V. (ed.) MODELS 2008. LNCS, vol. 5421, pp. 273–284. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-01648-6_29

    Chapter  Google Scholar 

  16. de Lara, J., Guerra, E.: From types to type requirements: genericity for model-driven engineering. Softw. Syst. Mod. 12(3), 453–474 (2013)

    Article  Google Scholar 

  17. Eclipse Modelling Framework. https://www.eclipse.org/modeling/emf/

  18. Epsilon. http://www.eclipse.org/gmt/epsilon

  19. Giese, M., Larsson, D.: Simplifying transformations of OCL constraints. In: Briand, L., Williams, C. (eds.) MODELS 2005. LNCS, vol. 3713, pp. 309–323. Springer, Heidelberg (2005). https://doi.org/10.1007/11557432_23

    Chapter  Google Scholar 

  20. Hassam, K., Sadou, S., Le Gloahec, V., Fleurquin, R.: Assistance system for OCL constraints adaptation during metamodel evolution. In: 2011 15th European Conference on Software Maintenance and Reengineering (CSMR), pp. 151–160. IEEE (2011)

    Google Scholar 

  21. Jouault, F., Allilaire, F., Bézivin, J., Kurtev, I.: ATL: a model transformation tool. Sci. Comput. Program. 72(1–2), 31–39 (2008). http://www.emn.fr/z-info/atlanmod/index.php/Main_Page. Accessed Nov 2010

    Article  MathSciNet  Google Scholar 

  22. Loveman, D.B.: Program improvement by source-to-source transformation. J. ACM (JACM) 24(1), 121–145 (1977)

    Article  MathSciNet  Google Scholar 

  23. Monperrus, M.: A critical review of automatic patch generation learned from human-written patches: essay on the problem statement and the evaluation of automatic software repair. In: Proceedings of the 36th International Conference on Software Engineering, pp. 234–242. ACM (2014)

    Google Scholar 

  24. Mottu, J.-M., Simula, S.S., Cadavid, J., Baudry, B.: Discovering model transformation pre-conditions using automatically generated test models. In: 2015 IEEE 26th International Symposium on Software Reliability Engineering (ISSRE), pp. 88–99. IEEE (2015)

    Google Scholar 

  25. OMG. Object Constraint Language (OCL) (2014). http://www.omg.org/spec/OCL/2.4/PDF

  26. Reimann, J., Wilke, C., Demuth, B., Muck, M., Aßmann, U.: Tool supported OCL refactoring catalogue. In: Proceedings of the 12th Workshop on OCL and Textual Modelling, Innsbruck, Austria, pp. 7–12, 30 September 2012

    Google Scholar 

  27. Rose, L., Guerra, E., De Lara, J., Etien, A., Kolovos, D., Paige, R.: Genericity for model management operations. Softw. Syst. Model. 12(1), 201–219 (2013)

    Article  Google Scholar 

  28. Solar-Lezama, A., Tancau, L., Bodik, R., Seshia, S., Saraswat, V.: Combinatorial sketching for finite programs. ACM Sigplan Not. 41(11), 404–415 (2006)

    Article  Google Scholar 

  29. Tibermacine, C., Sadou, S., Dony, C., Fabresse, L.: Component-based specification of software architecture constraints. In: Proceedings of the 14th International ACM Sigsoft Symposium on Component Based Software Engineering, pp. 31–40. ACM (2011)

    Google Scholar 

  30. Varró, D., Bergmann, G., Hegedüs, Á., Horváth, Á., Ráth, I., Ujhelyi, Z.: Road to a reactive and incremental model transformation platform: three generations of the VIATRA framework. Softw. Syst. Model. 15(3), 609–629 (2016)

    Article  Google Scholar 

  31. Wagelaar, D.: Simpleocl. https://github.com/dwagelaar/simpleocl

  32. Wimmer, M., Perez, S.M., Jouault, F., Cabot, J.: A catalogue of refactorings for model-to-model transformations. J. Object Technol. 11(2), 1–40 (2012)

    Google Scholar 

Download references

Acknowledgements

Work funded by the Spanish MINECO TIN2015-73968-JIN (AEI/FEDER/UE).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jesús Sánchez Cuadrado .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG, part of Springer Nature

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Cuadrado, J.S. (2018). Optimising OCL Synthesized Code. In: Pierantonio, A., Trujillo, S. (eds) Modelling Foundations and Applications. ECMFA 2018. Lecture Notes in Computer Science(), vol 10890. Springer, Cham. https://doi.org/10.1007/978-3-319-92997-2_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-92997-2_3

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-92996-5

  • Online ISBN: 978-3-319-92997-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics