A Basis for AspectJ Refactoring

Shimon Rura
Barbara Staudt Lerner
Computer Science Department
Williams College
srura@wso.williams.edu
lerner@cs.williams.edu

Abstract

Refactorings are specific code transformations that can improve the design of existing code without changing its behavior. Many refactorings for object-oriented programs are well known, and refactoring support is now common in IDEs. Authors of AspectJ programs, however, cannot take full advantage of this wisdom and tool support for two reasons. First, there is currently a limited set of aspect-oriented refactorings. A second, more fundamental, problem is that aspect-oriented language constructs can impact what changes are behavior-preserving. As a result, even traditional refactorings are unreliable. This paper presents a framework for judging whether a program transformation is a refactoring in AspectJ. This framework is then applied to establish AspectJ-safe versions of existing refactorings and several new refactorings specific to AOP designs.