Implementing Java modeling language contracts with AspectJ

The Java Modeling Language (JML) is a behavioral interface specification language (BISL) designed for Java. It was developed to improve functional software correctness of Java applications. However, instrumented object program generated by the JML compiler use the Java reflection mechanism and data structures not supported by Java ME applications. To deal with this limitation, we propose the use of AspectJ to implement a new JML compiler, which generates an instrumented bytecode compliant with both Java SE and Java ME applications. The paper includes a comparative study to demonstrate the quality of the final code generated by our compiler. The size of the code is compared against the code generated by an existent JML compiler. Moreover, we evaluate the amount of additional code required to implement the JML assertions in Java applications. Results indicate that the overhead in code size produced by our compiler is very small, which is essential for Java ME applications.

[1]  William G. Griswold,et al.  Getting started with ASPECTJ , 2001, CACM.

[2]  K. Rustan M. Leino,et al.  The Spec# Programming System: An Overview , 2004, CASSIS.

[3]  Gary T. Leavens,et al.  JML's Rich, Inherited Specifications for Behavioral Subtypes , 2006, ICFEM.

[4]  Yishai A. Feldman,et al.  Jose: Aspects for Design by Contract80-89 , 2006, Fourth IEEE International Conference on Software Engineering and Formal Methods (SEFM'06).

[5]  Roberto da Silva Bigonha,et al.  Optimized Compilation of Around Advice for Aspect Oriented Programs , 2007, J. Univers. Comput. Sci..

[6]  Gary T. Leavens,et al.  MultiJava: modular open classes and symmetric multiple dispatch for Java , 2000, OOPSLA '00.

[7]  MeyerBertrand,et al.  Design by Contract , 1997 .

[8]  Michael D. Ernst,et al.  An overview of JML tools and applications , 2003, International Journal on Software Tools for Technology Transfer.

[9]  Bertrand Meyer,et al.  Applying 'design by contract' , 1992, Computer.

[10]  Jianjun Zhao,et al.  Pipa: A Behavioral Interface Specification Language for AspectJ , 2003, FASE.

[11]  Paulo Maciel,et al.  CML: C Modeling Language , 2007 .

[12]  C. A. R. HOARE,et al.  An axiomatic basis for computer programming , 1969, CACM.

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

[14]  Bill Joy,et al.  Wireless J2ME Platform Programming , 2002 .