An Aspect-oriented Approach to Modular Behavioral Specification of Java Components

K. Yamada and T. Watanabe (Japan)

Keywords

Programming Tools and Languages, Designby Contract, Assertion, Java Modeling Language, AspectOriented Programming, AspectJ.

Abstract

Design-by-Contract (DbC) is a software development method that utilizes assertions in a principled manner, and is beneficial for building reliable software systems. How ever, in our experience of applying DbC to the development of a working application, we faced a difficulty in dealing with assertions that have properties spanning over the nat ural program structure. Such crosscutting properties make each assertion bulky and thus can be obstacles for devel oping, maintaining or extending large-scale systems. Our solution to this problem is to introduce a new modulariza tion mechanism based on assertion aspect, a new notion in aspect-oriented technology, to capture the crosscutting properties. We have designed a behavioral interface spec ification language Moxa that provides the mechanism. To examine our idea before developing Moxa tools, we have re-written the specification of our motivating application using AspectJ as a vehicle for prototyping modules for as sertion aspects. Then we have compared it to our origi nal, traditional DbC-based specification written in the Java Modeling Language (JML). The result shows that the use of assertion aspects clarifies the large, complex specification and greatly simplifies each assertion in the specification.

Important Links:



Go Back