Pattern-based mapping of OCL specifications to JML contracts

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. However, since OCL constraints cannot be directly executed and checked at runtime by an implementation, constraints violations may not be detected or noticed causing many potential development and maintenance problems. This paper describes an approach for deriving a JML specification for a java implementation (a contract) from a specification written in UML and augmented with OCL constraints. This facilitates the checking of OCL constraints at runtime by translating them to JML executable assertions. The approach is based on the concept of constraint patterns that enable the reuse of commonly occurring constraints within a given context in software modelling. Each OCL constraint pattern would be mapped to a corresponding JML pattern that can be used in the translation process. The result is a library of JML constraint patterns that provides a seamless transition from UML/OCL designs to Java implementations.

[1]  Yoonsik Cheon,et al.  A Library-Based Approach to Translating OCL Constraints to JML Assertions for Runtime Checking , 2008, Software Engineering Research and Practice.

[2]  David Frankel,et al.  Model Driven Architecture: Applying MDA to Enterprise Computing , 2003 .

[3]  David R. Cok,et al.  ESC/Java2: Uniting ESC/Java and JML , 2004, CASSIS.

[4]  Gary T. Leavens,et al.  How the design of JML accommodates both runtime assertion checking and formal verification , 2003, Sci. Comput. Program..

[5]  Bart Jacobs,et al.  Java Program Verification at Nijmegen: Developments and Perspective , 2003, ISSS.

[6]  Anneke Kleppe,et al.  The Object Constraint Language: Getting Your Models Ready for MDA , 2003 .

[7]  Albert L. Baker,et al.  Preliminary design of JML: a behavioral interface specification language for java , 2006, SOEN.

[8]  Ali Hamie,et al.  Translating the Object Constraint Language into the Java Modelling Language , 2004, SAC '04.

[9]  Yoonsik Cheon,et al.  A Runtime Assertion Checker for the Java Modeling Language (JML) , 2003, ICSE 2003.

[10]  Stephen H. Edwards,et al.  Model variables: cleanly supporting abstraction in design by contract , 2005, Softw. Pract. Exp..

[11]  James P. Davis,et al.  Propositional Logic Constraint Patterns and Their Use in UML-Based Conceptual Modeling and Analysis , 2007, IEEE Transactions on Knowledge and Data Engineering.

[12]  Achim D. Brucker,et al.  Model-Driven Constraint Engineering , 2006, Electron. Commun. Eur. Assoc. Softw. Sci. Technol..

[13]  Klaus Turowski,et al.  A Library of OCL Specification Patterns for Behavioral Specification of Software Components , 2006, CAiSE.

[14]  David R. Cok,et al.  ESC/Java2: Uniting ESC/Java and JML Progress and Issues in Building and Using ESC/Java2, Including a Case Study Involving the Use of the Tool to Verify Portions of an Internet Voting Tally System , 2005 .