Skip to main content

Generating Assertion Code from OCL: A Transformational Approach Based on Similarities of Implementation Languages

  • Conference paper
Model Driven Engineering Languages and Systems (MODELS 2009)

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

Abstract

The Object Constraint Language (OCL) carries a platform independent characteristic allowing it to be decoupled from implementation details, and therefore it is widely applied in model transformations used by model-driven development techniques. However, OCL can be found tremendously useful in the implementation phase aiding assertion code generation and allowing system verification. Yet, taking full advantage of OCL without destroying its platform independence is a difficult task. This paper proposes an approach for generating assertion code from OCL constraints by using a model transformation technique to abstract language specific details away from OCL high-level concepts, showing wide applicability of model transformation techniques. We take advantage of structural similarities of implementation languages to describe a rewriting framework, which is used to easily and flexibly reformulate OCL constraints into any target language, making them executable on any platform. A tool is implemented to demonstrate the effectiveness of this approach.

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 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. OMG: Model-Driven Architecture, http://www.omg.org/mda/

  2. OMG: Object Constraint Language specification, version 2.0, http://www.omg.org/technology/documents/formal/ocl.htm

  3. Kiczales, G., Irwin, J., Lamping, J., Loingtier, J.M., Lopes, C.V., Maeda, C., Mendhekar, A.: Aspect-oriented programming. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  4. The Maude Team: The Maude System, http://maude.cs.uiuc.edu/

  5. Akehurst, D.H., Patrascoiu, O.: OCL 2.0 – implementing the standard for multiple metamodels. Electronic Notes in Theoretical Computer Science 102, 21–41 (2004)

    Article  Google Scholar 

  6. Chabarek, F.: Development of an OCL-parser for UML-extensions. Master’s thesis, Technical University of Berlin (2004)

    Google Scholar 

  7. Clavel, M., Egea, M.: ITP/OCL: A rewriting-based validation tool for UML+OCL static class diagrams. In: Proc. 11th International Conference on Algebraic Methodology and Software Technology, pp. 368–373 (2006)

    Google Scholar 

  8. Karaorman, M., Hölzle, U., Bruno, J.L.: jContractor: A reflective Java library to support design by contract. In: Cointe, P. (ed.) Reflection 1999. LNCS, vol. 1616, pp. 175–196. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  9. Duncan, A., Hölzle, U.: Adding contracts to Java with Handshake. Technical Report TRCS98-32, Department of Computer Science, University of California (1998)

    Google Scholar 

  10. Dzidek, W.J., Briand, L.C., Labiche, Y.: Lessons learned from developing a dynamic OCL constraint enforcement tool for Java. In: Bruel, J.-M. (ed.) MoDELS 2005. LNCS, vol. 3844, pp. 10–19. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  11. Bartetzko, D., Fischer, C., Möller, M., Wehrheim, H.: Jass – Java with assertions. Electronic Notes in Theoretical Computer Science 55(2), 1–15 (2001)

    Article  Google Scholar 

  12. Kramer, R.: iContract – the Java design by contract tool. In: Proc. Technology of Object-Oriented Languages and Systems, pp. 295–307 (1998)

    Google Scholar 

  13. Burdy, L., Cheon, Y., Cok, D., Ernst, M., Kiniry, J., Leavens, G.T., Leino, K.R.M., Poll, E.: An overview of JML tools and applications. International Journal on Software Tools for Technology Transfer 7(3), 212–232 (2005)

    Article  Google Scholar 

  14. Cheon, Y., Leavens, G.T.: A runtime assertion checker for the Java Modeling Language (JML). In: Proc. International Conference on Software Engineering Research and Practice, pp. 322–328 (2002)

    Google Scholar 

  15. Leavens, G.T., Leino, K.R.M., Poll, E., Ruby, C., Jacobs, B.: JML: notations and tools supporting detailed design in Java. In: Companion Proc. 21st International Conference on Object-Oriented Programming Systems, Languages and Applications, pp. 105–106 (2000)

    Google Scholar 

  16. Hamie, A.: Translating the Object Constraint Language into the Java Modelling Language. In: Proc. 2004 ACM Symposium on Applied Computing, pp. 1531–1535 (2004)

    Google Scholar 

  17. Moiseev, R., Russo, A.: Implementing an OCL to JML translation tool. IEICE Technical Report 106(426) SS2006–58, 13–17 (2006)

    Google Scholar 

  18. Gogolla, M., Kuhlmann, M., Büttner, F.: Benchmark for OCL engine accuracy, determinateness, and efficiency. In: Czarnecki, K., Ober, I., Bruel, J.-M., Uhl, A., Völter, M. (eds.) MODELS 2008. LNCS, vol. 5301, pp. 446–459. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Moiseev, R., Hayashi, S., Saeki, M. (2009). Generating Assertion Code from OCL: A Transformational Approach Based on Similarities of Implementation Languages. In: Schürr, A., Selic, B. (eds) Model Driven Engineering Languages and Systems. MODELS 2009. Lecture Notes in Computer Science, vol 5795. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-04425-0_52

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-04425-0_52

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-04424-3

  • Online ISBN: 978-3-642-04425-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics