Systematic Testing of Refactoring Engines on Real Software Projects

Testing refactoring engines is a challenging problem that has gained recent attention in research. Several techniques were proposed to automate generation of programs used as test inputs and to help developers in inspecting test failures. However, these techniques can require substantial effort for writing test generators or finding unique bugs, and do not provide an estimate of how reliable refactoring engines are for refactoring tasks on real software projects. This paper evaluates an end-to-end approach for testing refactoring engines and estimating their reliability by (1) systematically applying refactorings at a large number of places in well-known, open-source projects and collecting failures during refactoring or while trying to compile the refactored projects, (2) clustering failures into a small, manageable number of failure groups, and (3) inspecting failures to identify non-duplicate bugs. By using this approach on the Eclipse refactoring engines for Java and C, we already found and reported 77 new bugs for Java and 43 for C. Despite the seemingly large numbers of bugs, we found these refactoring engines to be relatively reliable, with only 1.4% of refactoring tasks failing for Java and 7.5% for C.

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

[2]  Jeffrey Overbey,et al.  OpenRefactory/C: an infrastructure for developing program transformations for C programs , 2012, SPLASH '12.

[3]  Stas Negara,et al.  A Comparative Study of Manual and Automated Refactorings , 2013, ECOOP.

[4]  Mark Harman,et al.  Experimental assessment of software metrics using automated refactoring , 2012, Proceedings of the 2012 ACM-IEEE International Symposium on Empirical Software Engineering and Measurement.

[5]  Jan Wloka,et al.  Tool-supported refactoring of aspect-oriented programs , 2008, AOSD.

[6]  Michael D. Ernst,et al.  Refactoring sequential Java code for concurrency via concurrent libraries , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[7]  Sarfraz Khurshid,et al.  TestEra: a novel framework for automated testing of Java programs , 2001, Proceedings 16th Annual International Conference on Automated Software Engineering (ASE 2001).

[8]  Jeffrey Overbey,et al.  A toolkit for constructing refactoring engines , 2012 .

[9]  Zhendong Su,et al.  HDD: hierarchical delta debugging , 2006, ICSE.

[10]  George Loizou,et al.  Common refactorings, a dependency graph and some code smells: an empirical study of Java OSS , 2006, ISESE '06.

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

[12]  Perdita Stevens,et al.  Modelling Recursive Calls with UML State Diagrams , 2003, FASE.

[13]  Ralph E. Johnson,et al.  How do APIs evolve? A story of refactoring , 2006, J. Softw. Maintenance Res. Pract..

[14]  Theo D'Hondt,et al.  Dynamic Refactorings: Improving the Program Structure at Run-time , 2006, RAM-SE.

[15]  Tao Xie,et al.  An approach to detecting duplicate bug reports using natural language and execution information , 2008, 2008 ACM/IEEE 30th International Conference on Software Engineering.

[16]  Torbjörn Ekman,et al.  Sound and extensible renaming for java , 2008, OOPSLA.

[17]  Andreas Zeller,et al.  Simplifying and Isolating Failure-Inducing Input , 2002, IEEE Trans. Software Eng..

[18]  Frank Tip,et al.  Refactoring Java programs for flexible locking , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

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

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

[21]  Rohit Gheyi,et al.  Making Program Refactoring Safer , 2010, IEEE Software.

[22]  Darko Marinov,et al.  Reducing the Costs of Bounded-Exhaustive Testing , 2009, FASE.

[23]  Sarfraz Khurshid,et al.  TestEra A Novel Framework for Testing Java Programs y , 2003 .

[24]  Diomidis Spinellis,et al.  CScout: A refactoring browser for C , 2010, Sci. Comput. Program..

[25]  Tao Xie,et al.  JDF: detecting duplicate bug reports in Jazz , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[26]  Ralph Johnson,et al.  How do APIs evolveq A story of refactoring: Research Articles , 2006 .

[27]  Adam Kiezun,et al.  Grammar-based whitebox fuzzing , 2008, PLDI '08.

[28]  Thomas Zimmermann,et al.  Duplicate bug reports considered harmful … really? , 2008, 2008 IEEE International Conference on Software Maintenance.

[29]  Sarfraz Khurshid,et al.  Korat: automated testing based on Java predicates , 2002, ISSTA '02.

[30]  Max Schaefer Specification, implementation and verification of refactorings , 2010 .

[31]  Sarfraz Khurshid,et al.  Test generation through programming in UDITA , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

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

[33]  Andrew D. Gordon,et al.  Maintaining Database Integrity with Refinement Types , 2011, ECOOP.

[34]  Andy Podgurski,et al.  CARIAL: Cost-Aware Software Reliability Improvement with Active Learning , 2012, 2012 IEEE Fifth International Conference on Software Testing, Verification and Validation.

[35]  Xuejun Yang,et al.  Test-case reduction for C compiler bugs , 2012, PLDI.

[36]  Rohit Gheyi,et al.  Analyzing Refactorings on Software Repositories , 2011, 2011 25th Brazilian Symposium on Software Engineering.

[37]  Petra Perner,et al.  Data Mining - Concepts and Techniques , 2002, Künstliche Intell..

[38]  Zack Coker,et al.  Program transformations to fix C integers , 2013, 2013 35th International Conference on Software Engineering (ICSE).