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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Warmer, J., Kleppe, A.: The object constraint language: getting your models ready for MDA. Addison-Wesley, Reading (2003)
OMG (Object Management Group): Object Constraint Language (OCL), Version 2.4 (2014)
OMG (Object Management Group): Unified Modeling Language Specification, Version 2.5 (2013)
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)
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)
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)
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)
Wahler, M.: Using Patterns to Develop Consistent Design Constraints. Ph.D. thesis, ETH Zurich, Switzerland (2008)
Wahler, M., Basin, D., Brucker, A., Koehler, J.: Efficient analysis of pattern-based constraint specifications. Softw. Syst. Model. 9, 225–255 (2010)
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)
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)
Hamie, A.: Strategies for Translating the UML/OCL Design Models to JAVA/JML Designs. In: International Computer Symposium, Taiwan (2004)
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)
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)
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)
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)
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)
Frankel, D.: Model Driven Architecture: Applying MDA to Enterprise Computing. Wiley, New York (2002)
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)
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)
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)
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)
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)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights 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)