Skip to main content

Using Patterns to Map OCL Constraints to JML Specifications

  • Conference paper
  • First Online:
Model-Driven Engineering and Software Development (MODELSWARD 2014)

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 506))

Abstract

OCL is a formal notation to specify constraints on UML models that cannot otherwise be expressed using diagrammatic notations such as class diagrams. The type of constraints that can be expressed using OCL include class invariants and operation preconditions and postconditions. Constraint patterns can be used to simplify the development of consistent constraints for UML/OCL models. This paper investigates an approach based on constraint patterns to developing JML specifications for Java implementations from OCL constraints. This would enable the checking of OCL constraints at runtime since they can be translated to JML executable assertions. The approach involves mapping each OCL constraint pattern to a corresponding JML pattern. This results in a library of JML constraint patterns that provides a seamless transition from UML/OCL designs to Java implementations.

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

References

  1. Warmer, J., Kleppe, A.: The object constraint language: getting your models ready for MDA. Addison-Wesley, Reading (2003)

    Google Scholar 

  2. OMG (Object Management Group): Object Constraint Language (OCL), Version 2.4 (2014)

    Google Scholar 

  3. OMG (Object Management Group): Unified Modeling Language Specification, Version 2.5 (2013)

    Google Scholar 

  4. Ackermann, J.: Frequently occurring patterns in behavioral specification of software components. In: Proceedings of the Conference on Component-Oriented Enterprise Applications (COEA), pp. 41–56 (2005)

    Google Scholar 

  5. Ackermann, J.: Formal description of OCL specification patterns for behavioral specification of software components. In: Workshop on Tool Support for OCL and Related Formalisms, Technical Report LGL-REPORT-2005-001, EPFL, pp. 15–29 (2005)

    Google Scholar 

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

    Chapter  Google Scholar 

  7. Davis, J.P., Bonnell, R.D.: Propositional logic constraint patterns and their use in UML-based conceptual modeling and analysis. IEEE Trans. Knowl. and Data Eng. 19, 427–440 (2007)

    Article  Google Scholar 

  8. Wahler, M.: Using Patterns to Develop Consistent Design Constraints. Ph.D. thesis, ETH Zurich, Switzerland (2008)

    Google Scholar 

  9. Wahler, M., Basin, D., Brucker, A., Koehler, J.: Efficient analysis of pattern-based constraint specifications. Softw. Syst. Model. 9, 225–255 (2010)

    Article  Google Scholar 

  10. Wahler, M., Koehler, J., Brucker, A.D.: Model-driven constraint engineering. In: MoDELS Workshp. on OCL for (Meta-)Models in Multiple Application Domains, pp. 111–125 (2006)

    Google Scholar 

  11. Hamie, A.: Towards verifying java realizations of OCL-constrained design models using JML. In: Proceedings of the 6th IASTED International Conference on Software Engineering and Applications (SEA 2002). IASTED Press (2002)

    Google Scholar 

  12. Hamie, A.: Strategies for Translating the UML/OCL Design Models to JAVA/JML Designs. In: International Computer Symposium, Taiwan (2004)

    Google Scholar 

  13. Hamie, A.: Translating the object constraint language into the java modelling language. In: Proceedings of the ACM Symposium on Applied Computing, pp. 1531–1535. ACM Press (2004)

    Google Scholar 

  14. Avila, C., Flores, G., Cheon, Y.: A library-based approach to translating OCL constraints to JML assertions for runtime checking. In: International Conference on Software Engineering Research and Practice, pp. 403–408. CSREA Press (2008)

    Google Scholar 

  15. Leavens, G.T., Baker, A.L., Ruby, C.: Preliminary design of JML: a behavioral interface specification language for java. ACM SIGSOFT Softw. Eng. Not. 31, 1–38 (2006)

    Article  Google Scholar 

  16. Cheon, Y., Leavens, G.T.: A runtime assertion checker for the java modeling language (JML). In: International Conference on Software Engineering Research and Practice, pp. 322–328. CSREA Press (2002)

    Google Scholar 

  17. Cheon, Y., Leavens, G.T., Sitaraman, M., Edwards, S.: Model variables: cleanly supporting abstraction in design by contract. Softw.: Pract. Exp. 35, 583–599 (2005)

    Google Scholar 

  18. Frankel, D.: Model Driven Architecture: Applying MDA to Enterprise Computing. Wiley, New York (2002)

    Google Scholar 

  19. Leavens, G.T., Cheon, Y., Clifton, C., Ruby, C., Cok, D.R.: How the design of JML accommodates both runtime assertion checking and formal verification. Sci. Comput. Program. 55, 185–208 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  20. Cok, D., Kiniry, J.: ESC/Java2: uniting ESC/Java and JML. In: Barthe, G., Burdy, L., Huisman, M., Lanet, J.L., Muntean, T. (eds.) ASSIS 2004. LNCS, vol. 3362, pp. 108–128. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  21. Jacobs, B., Poll, E.: Java program verification at nijmegen: developments and perspective. In: Futatsugi, K., Mizoguchi, F., Yonezaki, N. (eds.) ISSS 2003. LNCS, vol. 3233, pp. 134–153. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  22. Hamie, A.: Pattern-based mapping of OCL specifications to JML contracts. In: Proceedings of the 2nd International Conference on Model-Driven Engineering and Software Development (MODELSWARD) (2014)

    Google Scholar 

  23. Gosling, J., Joy, B., Steele, G., Bracha, G., Buckley, A.: The Java Language Specification, Java SE 8 Edition (Java Series). Addison-Wesley, Upper Saddle River (2014)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ali Hamie .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this paper

Cite this paper

Hamie, A. (2015). Using Patterns to Map OCL Constraints to JML Specifications. In: Hammoudi, S., Pires, L., Filipe, J., das Neves, R. (eds) Model-Driven Engineering and Software Development. MODELSWARD 2014. Communications in Computer and Information Science, vol 506. Springer, Cham. https://doi.org/10.1007/978-3-319-25156-1_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-25156-1_3

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-25155-4

  • Online ISBN: 978-3-319-25156-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics