Skip to Main Content
Software often needs to be modified to accommodate requirements changes during the software lifecycle. To deal with several accidental requirements changes related to software maintenance, a systematic and safe approach to modifying software is needed. Design patterns provide a high degree of design flexibility for such accidental requirements changes. In this paper, we propose an automated approach to refactoring based on design patterns in Java programs. In our approach, for a particular design pattern, we define an inference rule to automatically identify a set of candidate spots and a refactoring strategy to transform a candidate spot into the desired design pattern structure. A candidate spot may be a class or a set of classes to which design patterns can be applied. We believe that our approach would be helpful to maintainers in the sense that much manual analysis of source code can be reduced, and the method of automated program transformation preserves behavior of the original program by means of the refactoring technique.
Date of Conference: 2002