Manual refactoring changes with automated refactoring validation

Refactoring, the practice of applying behavior-preserving changes to existing code, can enhance the quality of software systems. Refactoring tools can automatically perform and check the correctness of refactorings. However, even when developers have these tools, they still perform about 90% of refactorings manually, which is error-prone. To address this problem, we propose a technique called GhostFactor separating transformation and correctness checking: we allow the developer to transform code manually, but check the correctness of her transformation automatically. We implemented our technique as a Visual Studio plugin, then evaluated it with a human study of eight software developers; GhostFactor improved the correctness of manual refactorings by 67%.

[1]  Gabriele Bavota,et al.  Identifying Extract Class refactoring opportunities using structural and semantic cohesion measures , 2011, J. Syst. Softw..

[2]  Ralph E. Johnson,et al.  Drag-and-drop refactoring: Intuitive and efficient program transformation , 2013, 2013 35th International Conference on Software Engineering (ICSE).

[3]  Thomas Fritz,et al.  Refactoring to aspects: an interactive approach , 2003, eclipse '03.

[4]  Alberto Sillitti,et al.  Does Refactoring Improve Reusability? , 2006, ICSR.

[5]  Robert DeLine,et al.  Let's go to the whiteboard: how and why software developers use drawings , 2007, CHI.

[6]  K. H. Bennett,et al.  Journal of software maintenance : research and practice , 1989 .

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

[8]  Oege de Moor,et al.  Specifying and implementing refactorings , 2010, OOPSLA.

[9]  Tom Mens,et al.  Design preservation over subsequent releases of a software product: a case study of Baan ERP: Practice Articles , 2005 .

[10]  Harald C. Gall,et al.  Improving evolvability through refactoring , 2005, MSR.

[11]  Jeffrey Overbey,et al.  Differential precondition checking: A lightweight, reusable analysis for refactoring tools , 2011, 2011 26th IEEE/ACM International Conference on Automated Software Engineering (ASE 2011).

[12]  Miryung Kim,et al.  Template-based reconstruction of complex refactorings , 2010, 2010 IEEE International Conference on Software Maintenance.

[13]  Torbjörn Ekman,et al.  Stepping Stones over the Refactoring Rubicon , 2009, ECOOP.

[14]  Dirk Muthig,et al.  A case study in refactoring a legacy component for reuse in a product line , 2005, 21st IEEE International Conference on Software Maintenance (ICSM'05).

[15]  Gabriele Bavota,et al.  Playing with refactoring: Identifying extract class opportunities through game theory , 2010, 2010 IEEE International Conference on Software Maintenance.

[16]  Andrew P. Black,et al.  Programmer-Friendly Refactoring Errors , 2012, IEEE Transactions on Software Engineering.

[17]  Gabriele Bavota,et al.  A two-step technique for extract class refactoring , 2010, ASE.

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

[19]  Zhenchang Xing,et al.  Refactoring Practice: How it is and How it Should be Supported - An Eclipse Case Study , 2006, 2006 22nd IEEE International Conference on Software Maintenance.

[20]  H. B. Mann,et al.  On a Test of Whether one of Two Random Variables is Stochastically Larger than the Other , 1947 .

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

[22]  Jose Meseguer,et al.  Formal Specification and Verification of Java Refactorings , 2006, 2006 Sixth IEEE International Workshop on Source Code Analysis and Manipulation.

[23]  Miryung Kim,et al.  A field study of refactoring challenges and benefits , 2012, SIGSOFT FSE.

[24]  Max Schaefer,et al.  Stepping Stones over the Refactoring Rubicon – Lightweight Language Extensions to Easily Realise Refactorings , 2009 .

[25]  William G. Griswold,et al.  WitchDoctor: IDE support for real-time auto-completion of refactorings , 2012, 2012 34th International Conference on Software Engineering (ICSE).

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

[27]  Emerson R. Murphy-Hill,et al.  Reconciling manual and automatic refactoring , 2012, 2012 34th International Conference on Software Engineering (ICSE).

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

[29]  Nikolai Tillmann,et al.  Precise identification of problems for structural test generation , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

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

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

[32]  Emerson Murphy-Hill,et al.  Programmer friendly refactoring tools , 2009 .