Design Pattern Refactoring by Pretty-Printing

Most design patterns in the Gang-of-Four text can be written as a refactoring script – a programmatic sequence of refactorings.R is a new Java refactoring engine based on prettyprinting. It builds a main-memory, non-persistent database to encode containment relationships among Java entity declarations (e.g., packages, classes, methods), language features such as inheritance and modifiers, and precondition checks for each declaration. R design pattern scripts modify the database and do not modify Abstract Syntax Trees (ASTs). While classical refactoring engines transform source code or ASTs directly, R produces refactored code by displaying the contents of the modified database when pretty-printing ASTs. R performs comparable precondition checks and code changes to that of the Eclipse Java Development Tools (JDT) refactorings but R’s codebase is about half the size of JDT refactorings and runs an order of magnitude faster. R refactorings pass relevant regression tests in JDT and fix JDT refactoring bugs that we found.

[1]  D. Batory,et al.  Scaling step-wise refinement , 2003, IEEE Transactions on Software Engineering.

[2]  Oege de Moor,et al.  JunGL: a scripting language for refactoring , 2006, ICSE.

[3]  Pierre-Etienne Moreau,et al.  Tom: Piggybacking Rewriting on Java , 2007, RTA.

[4]  Darko Marinov,et al.  Automated testing of refactoring engines , 2007, ESEC-FSE '07.

[5]  John Brant,et al.  The SmaCC transformation engine: how to convert your entire code base into a different programming language , 2009, OOPSLA Companion.

[6]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[7]  Frank Tip,et al.  A Comprehensive Approach to Naming and Accessibility in Refactoring Java Programs , 2012, IEEE Transactions on Software Engineering.

[8]  Friedrich Steimann,et al.  From Public to Private to Absent: Refactoring Java Programs under Constrained Accessibility , 2009, ECOOP.

[9]  Tom Mens,et al.  A declarative evolution framework for object-oriented design patterns , 2001, Proceedings IEEE International Conference on Software Maintenance. ICSM 2001.

[10]  Alessandro Orso,et al.  Automated Behavioral Regression Testing , 2010, 2010 Third International Conference on Software Testing, Verification and Validation.

[11]  Gustavo Soares,et al.  Automated Behavioral Testing of Refactoring Engines , 2013, IEEE Transactions on Software Engineering.

[12]  Charles Simonyi,et al.  Intentional software , 2006, OOPSLA '06.

[13]  Don Batory,et al.  Scripting Refactorings in Java to Introduce Design Patterns , 2014 .

[14]  Don Roberts,et al.  Practical analysis for refactoring , 1999 .

[15]  Andrew Begel,et al.  Managing Duplicated Code with Linked Editing , 2004, 2004 IEEE Symposium on Visual Languages - Human Centric Computing.

[16]  David Hovemeyer,et al.  Evaluating and tuning a static analysis to find null pointer bugs , 2005, PASTE '05.

[17]  Kent L. Beck,et al.  Extreme programming explained - embrace change , 1990 .

[18]  Ravichandhran Madhavan,et al.  Null dereference verification via over-approximated weakest pre-conditions analysis , 2011, OOPSLA '11.

[19]  Jurriaan Hage,et al.  Implementation and Application of Functional Languages , 2011, Lecture Notes in Computer Science.

[20]  Arie van Deursen,et al.  The Asf+Sdf Meta-Environment: a Component-Based Language Development Environment , 2001, LDTA@ETAPS.

[21]  Don S. Batory,et al.  Evolving Object-Oriented Designs with Refactorings , 2004, Automated Software Engineering.

[22]  Mangala Gowri Nanda,et al.  Accurate Interprocedural Null-Dereference Analysis for Java , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[23]  Shujuan Jiang,et al.  Fault localization and repair for Java runtime exceptions , 2009, ISSTA.

[24]  Paul Klint,et al.  Scripting a refactoring with Rascal and Eclipse , 2012, WRT '12.

[25]  Eelco Visser,et al.  Stratego/XT 0.17. A language and toolset for program transformation , 2008, Sci. Comput. Program..

[26]  Ralph E. Johnson,et al.  Automated Detection of Refactorings in Evolving Components , 2006, ECOOP.

[27]  Mauricio A. Saca Refactoring improving the design of existing code , 2017, 2017 IEEE 37th Central America and Panama Convention (CONCAPAN XXXVII).

[28]  Stas Negara,et al.  Use, disuse, and misuse of automated refactorings , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[29]  Danny Dig A Refactoring Approach to Parallelism , 2011, IEEE Software.

[30]  Friedrich Steimann,et al.  Constraint-Based Refactoring with Foresight , 2012, ECOOP.

[31]  Gabriele Bavota,et al.  When Does a Refactoring Induce Bugs? An Empirical Study , 2012, 2012 IEEE 12th International Working Conference on Source Code Analysis and Manipulation.

[32]  Eric Latimer,et al.  Teaching model-driven engineering from a relational database perspective , 2013, Software & Systems Modeling.

[33]  Susan L. Graham,et al.  iXj: interactive source-to-source transformations for java , 2004, OOPSLA '04.

[34]  William G. Griswold Program restructuring as an aid to software maintenance , 1992 .

[35]  Andrew P. Black,et al.  How we refactor, and how we know it , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[36]  William Pugh,et al.  Null dereference analysis in practice , 2010, PASTE '10.

[37]  Robert C. Martin Agile Software Development, Principles, Patterns, and Practices , 2002 .

[38]  Joshua Kerievsky,et al.  Refactoring to Patterns , 2004, XP/Agile Universe.

[39]  Friedrich Steimann,et al.  A Refactoring Constraint Language and Its Application to Eiffel , 2011, ECOOP.

[40]  James R. Cordy,et al.  The TXL source transformation language , 2006, Sci. Comput. Program..

[41]  Huiqing Li,et al.  A Domain-Specific Language for Scripting Refactorings in Erlang , 2012, FASE.

[42]  Kent Beck,et al.  Extreme Programming Explained: Embrace Change (2nd Edition) , 2004 .

[43]  Greg Nelson,et al.  Extended static checking for Java , 2002, PLDI '02.

[44]  Christopher W. Pidgeon,et al.  DMS®: Program Transformations for Practical Scalable Software Evolution , 2002, IWPSE '02.

[45]  Jeffrey Overbey,et al.  Systematic Testing of Refactoring Engines on Real Software Projects , 2013, ECOOP.