Checking correctness with respect to a formal semantics is expensive. Thus, the refactoring tools are commonly implemented in an ad hoc way and may perform transformations that do not preserve behavior. The problem becomes still worse when we consider refactoring aspect-oriented (AO) programs. We present a practical technique for increasing confidence on whether a given transformation applied to an AO program preserves behavior. This technique was evaluated against 12 transformations, performed in Eclipse, which intended to be refactorings. It detected that 91% of them do not preserve behavior. A second evaluation was accomplished with a 65-KLOC real case study containing 475 classes. It is implemented in Java and was refactored to AspectJ. Both versions are intended to be equivalent, but our technique detected a behavioral change.
['Diego Cavalcanti']
Improving safety when refactoring aspect-oriented programs