Advertisement

Using Patterns to Map OCL Constraints to JML Specifications

  • Ali HamieEmail author
Conference paper
Part of the Communications in Computer and Information Science book series (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.

Keywords

Constraints Patterns OCL JML 

References

  1. 1.
    Warmer, J., Kleppe, A.: The object constraint language: getting your models ready for MDA. Addison-Wesley, Reading (2003)Google Scholar
  2. 2.
    OMG (Object Management Group): Object Constraint Language (OCL), Version 2.4 (2014)Google Scholar
  3. 3.
    OMG (Object Management Group): Unified Modeling Language Specification, Version 2.5 (2013)Google Scholar
  4. 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. 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. 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)CrossRefGoogle Scholar
  7. 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)CrossRefGoogle Scholar
  8. 8.
    Wahler, M.: Using Patterns to Develop Consistent Design Constraints. Ph.D. thesis, ETH Zurich, Switzerland (2008)Google Scholar
  9. 9.
    Wahler, M., Basin, D., Brucker, A., Koehler, J.: Efficient analysis of pattern-based constraint specifications. Softw. Syst. Model. 9, 225–255 (2010)CrossRefGoogle Scholar
  10. 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. 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. 12.
    Hamie, A.: Strategies for Translating the UML/OCL Design Models to JAVA/JML Designs. In: International Computer Symposium, Taiwan (2004)Google Scholar
  13. 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. 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. 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)CrossRefGoogle Scholar
  16. 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. 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. 18.
    Frankel, D.: Model Driven Architecture: Applying MDA to Enterprise Computing. Wiley, New York (2002)Google Scholar
  19. 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)MathSciNetCrossRefzbMATHGoogle Scholar
  20. 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)CrossRefGoogle Scholar
  21. 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)CrossRefGoogle Scholar
  22. 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. 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

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  1. 1.School of Computing, Engineering and MathematicsUniversity of BrightonBrightonUK

Personalised recommendations