Implementing Java modeling language contracts with AspectJ
Proceedings of the 2008 ACM symposium on Applied computing
Checking concurrent contracts with aspects
Proceedings of the 2010 ACM Symposium on Applied Computing
On the interplay of exception handling and design by contract: an aspect-oriented recovery approach
Proceedings of the 13th Workshop on Formal Techniques for Java-Like Programs
Science of Computer Programming
Identifying and specifying crosscutting contracts with AspectJML
Proceedings of the 2013 companion publication for conference on Systems, programming, & applications: software for humanity
Hi-index | 0.00 |
Design by contract is a practical methodology for evolving code together with its specification. The contract has important methodological implications on the design of the program. In addition, tools that instrument the code to check for contract violations help the development process by catching errors close to their sources. This is complicated by several factors, such as the need to collect preconditions from supertypes. There are two issues involved in the implementation of such a tool: the correct enforcement of the theoretical principles, and the instrumentation of the code. Most previous tools tackle both issues, but have subtle failures in one or the other. This paper describes Jose, a tool for design by contract in Java, which uses AspectJ, an aspect-oriented extension of Java, to instrument the program. This allows us to leverage the expertise of the AspectJ developers in instrumenting Java programs, and concentrate on the correct implementation of the designby- contract principles. This approach has the added benefit that it can be generalized to other object-oriented languages that have aspect-oriented extensions. We describe the design decisions made in the implementation of Jose, and the features of AspectJ that helped or hindered this implementation.