Identifying composite refactorings with a scripting language

Automatic refactoring techniques guarantee the correctness and effectiveness for the transformation of legacy software systems. Our experience of identifying composite refactorings shows that existing techniques can not easily be used to identify them because of the complexity of their composition and the behavior preservation requirement. Inspired by the HTN model which is adopted to formalize the behaviors of composite refactorings, we design a scripting language FLAT, which expresses users' solution for refactoring identification. It provides expressive and understandable representation for composite refactorings. To perform this language, we implement its interpreter EXTRACTOR, an extensible framework with template mechanism. Refactoring compositions are identified by EXTRACTOR constructor, while low-level logic operations on program's intermediate representation are provided by logic query engine. We evaluate EXTRACTOR through various cases and prove its effectiveness of identifying composite refactorings even for aspect-oriented programs.

[1]  Mel Ó Cinnéide,et al.  A methodology for the automated introduction of design patterns , 1999, Proceedings IEEE International Conference on Software Maintenance - 1999 (ICSM'99). 'Software Maintenance for Business Change' (Cat. No.99CB36360).

[2]  Barbara Staudt Lerner,et al.  A Basis for AspectJ Refactoring , 2010 .

[3]  Günter Kniesel,et al.  Static composition of refactorings , 2004, Sci. Comput. Program..

[4]  Stefan Edelkamp,et al.  Automated Planning: Theory and Practice , 2007, Künstliche Intell..

[5]  Earl D. Sacerdoti,et al.  The Nonlinear Nature of Plans , 1975, IJCAI.

[7]  William F. Opdyke,et al.  Refactoring object-oriented frameworks , 1992 .

[8]  Günter Kniesel A Logic Foundation for Program Transformations , 2006 .

[9]  Günter Kniesel,et al.  A comparison of logic-based infrastructures for concern detection and extraction , 2007, LATE@AOSD.

[10]  Javier Pérez,et al.  Enabling Refactoring with HTN Planning to Improve the Design Smells Correction Activity , 2008 .

[11]  Patrick Nixon,et al.  Composite Refactorings for Java Programs , 2000 .

[12]  João M. Fernandes,et al.  Refactoring a Java code base to AspectJ: an illustrative example , 2005, 21st IEEE International Conference on Software Maintenance (ICSM'05).

[13]  Tom Mens,et al.  Identifying refactoring opportunities using logic meta programming , 2003, Seventh European Conference onSoftware Maintenance and Reengineering, 2003. Proceedings..

[14]  Ondrej Lhoták,et al.  abc: an extensible AspectJ compiler , 2005, AOSD '05.