Implementing Java modeling language contracts with AspectJ

  • Authors:
  • Henrique Rebêlo;Sérgio Soares;Ricardo Lima;Leopoldo Ferreira;Márcio Cornélio

  • Affiliations:
  • Pernambuco State University, Pernambuco, Brazil;Pernambuco State University, Pernambuco, Brazil;Pernambuco State University, Pernambuco, Brazil;Pernambuco State University, Pernambuco, Brazil;Pernambuco State University, Pernambuco, Brazil

  • Venue:
  • Proceedings of the 2008 ACM symposium on Applied computing
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.