@misc{9488, author = {Lionel Briand and James Dzidek and Yvan Labiche}, title = {Instrumenting Contracts With Aspect-Oriented Programming to Increase Observability and Support Debugging}, abstract = {Analysis and design by contract allows the definition of a formal agreement between a class and its clients, expressing each party{\textquoteright}s rights and obligations. Operation contracts and class invariants are known to be a useful technique to specify the precondition and postcondition of operations and the legal states of class instances in an object-oriented context, making the definition of object-oriented analysis or design elements more precise. Furthermore, it is also useful to check such contracts and invariants at run time in order to help testing and debugging during corrective maintenance. Indeed, experiments report a substantial gain when relying on instrumented contracts during those two activities. However, the instrumentation of such contracts is a time consuming activity. In this paper we report on how Aspect-Oriented Programming (AOP), using AspectJ, can be employed to automatically and efficiently instrument contracts and invariants in Java. The paper focuses on (1) the AspectJ templates to instrument preconditions, postconditions, and class invariants, (2) the necessary instrumentation for compliance-checking to the Liskov Substitution Principle.}, year = {2005}, journal = {21st IEEE International Conference on Software Maintenance (ICSM), Budapest, Hungary, September 25-30}, pages = {687-690}, publisher = {IEEE}, isbn = {0-7695-2368-4}, note = {Use of the attached PDF is subject to the IEEE terms found here: http://www.computer.org/portal/pages/csdl/content/Terms.html}, editor = {IEEE Society}, }