Towards Refactoring-Aware Regression Test Selection

Regression testing checks that recent project changes do not break previously working functionality. Although important, regression testing is costly when changes are frequent. Regression test selection (RTS) optimizes regression testing by running only tests whose results might be affected by a change. Traditionally, RTS collects dependencies (e.g., on files) for each test and skips the tests, at a new project revision, whose dependencies did not change. Existing RTS techniques do not differentiate behavior-preserving transformations (i.e., refactorings) from other code changes. As a result, tests are run more frequently than necessary. We present the first step towards a refactoring-aware RTS technique, dubbed Reks, which skips tests affected only by behavior-preserving changes. Reks defines rules to update the test dependencies without running the tests. To ensure that Reks does not hide any bug introduced by the refactoring engines, we integrate Reks only in the pre-submit testing phase, which happens on the developers' machines. We evaluate Reks by measuring the savings in the testing effort. Specifically, we reproduce 100 refactoring tasks performed by developers of 37 projects on GitHub. Our results show that Reks would not run, on average, 33% of available tests (that would be run by a refactoring-unaware RTS technique). Additionally, we systematically run 27 refactoring types on ten projects. The results, based on 74,160 refactoring tasks, show that Reks would not run, on average, 16% of tests (max: 97% and SD: 24%). Finally, our results show that the Reks update rules are efficient.

[1]  Sarfraz Khurshid,et al.  Localizing failure-inducing program edits based on spectrum information , 2011, 2011 27th IEEE International Conference on Software Maintenance (ICSM).

[2]  Swarnendu Biswas,et al.  Regression Test Selection Techniques: A Survey , 2011, Informatica.

[3]  Mark Harman,et al.  Regression testing minimization, selection and prioritization: a survey , 2012, Softw. Test. Verification Reliab..

[4]  Per Runeson,et al.  A systematic review on regression test selection techniques , 2010, Inf. Softw. Technol..

[5]  Miryung Kim,et al.  Prioritizing test cases for early detection of refactoring faults , 2016, Softw. Test. Verification Reliab..

[6]  Don S. Batory,et al.  Scripting parametric refactorings in Java to retrofit design patterns , 2015, 2015 IEEE International Conference on Software Maintenance and Evolution (ICSME).

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

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

[9]  Emerson R. Murphy-Hill,et al.  Live feedback on behavioral changes , 2013, 2013 1st International Workshop on Live Programming (LIVE).

[10]  Darko Marinov,et al.  An extensive study of static regression test selection in modern software evolution , 2016, SIGSOFT FSE.

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

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

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

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

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

[16]  Frank Tip,et al.  Chianti: a tool for change impact analysis of java programs , 2004, OOPSLA.

[17]  Gregg Rothermel,et al.  Techniques for improving regression testing in continuous integration development environments , 2014, SIGSOFT FSE.

[18]  Amitabh Srivastava,et al.  Effectively prioritizing tests in development environment , 2002, ISSTA '02.

[19]  Per Runeson,et al.  A Qualitative Survey of Regression Testing Practices , 2010, PROFES.

[20]  James M. Bieman,et al.  Testing During Refactoring: Adding Aspects to Legacy Systems , 2006, 2006 17th International Symposium on Software Reliability Engineering.

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

[22]  Lionel C. Briand,et al.  Coverage‐based regression test case selection, minimization and prioritization: a case study on an industrial system , 2015, Softw. Test. Verification Reliab..

[23]  Darko Marinov,et al.  Practical regression test selection with dynamic file dependencies , 2015, ISSTA.

[24]  Emerson R. Murphy-Hill,et al.  Manual refactoring changes with automated refactoring validation , 2014, ICSE.

[25]  Michael D. Ernst,et al.  An experimental evaluation of continuous testing during development , 2004, ISSTA '04.

[26]  Torbjörn Ekman,et al.  Challenge proposal: verification of refactorings , 2009, PLPV '09.

[27]  Atanas Rountev,et al.  Regression Test Selection for AspectJ Software , 2007, 29th International Conference on Software Engineering (ICSE'07).

[28]  Gabriele Bavota,et al.  There and back again: Can you compile that snapshot? , 2017, J. Softw. Evol. Process..

[29]  Gregg Rothermel,et al.  Analyzing Regression Test Selection Techniques , 1996, IEEE Trans. Software Eng..

[30]  Lu Zhang,et al.  How Does Regression Test Prioritization Perform in Real-World Software Evolution? , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[31]  Michael D. Ernst,et al.  Feedback-Directed Random Test Generation , 2007, 29th International Conference on Software Engineering (ICSE'07).

[32]  David Chenho Kung,et al.  Class Firewall, Test Order, and Regression Testing of Object-Oriented Programs , 1995, J. Object Oriented Program..

[33]  Darko Marinov,et al.  Ekstazi: Lightweight Test Selection , 2015, 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.

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

[35]  Don S. Batory,et al.  Improving Refactoring Speed by 10X , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[36]  Miryung Kim,et al.  An empirical investigation into the impact of refactoring on regression testing , 2012, 2012 28th IEEE International Conference on Software Maintenance (ICSM).

[37]  Per Runeson,et al.  Improving Class Firewall Regression Test Selection by Removing the Class Firewall , 2007, Int. J. Softw. Eng. Knowl. Eng..

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

[39]  Rohit Gheyi,et al.  Automated Behavioral Testing of Refactoring Engines , 2013, IEEE Trans. Software Eng..

[40]  Darko Marinov,et al.  Usage, costs, and benefits of continuous integration in open-source projects , 2016, 2016 31st IEEE/ACM International Conference on Automated Software Engineering (ASE).

[41]  Frank Tip,et al.  Refactoring for generalization using type constraints , 2003, OOPSLA '03.

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

[43]  Paulo Borba,et al.  Making refactoring safer through impact analysis , 2014, Sci. Comput. Program..

[44]  David S. Rosenblum,et al.  TESTTUBE: a system for selective regression testing , 1994, Proceedings of 16th International Conference on Software Engineering.

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

[46]  Stas Negara,et al.  An empirical evaluation and comparison of manual and automated test selection , 2014, ASE.

[47]  Robert Feldt,et al.  Dynamic Regression Test Selection Based on a File Cache An Industrial Evaluation , 2009, 2009 International Conference on Software Testing Verification and Validation.

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

[49]  Miryung Kim,et al.  Ref-Finder: a refactoring reconstruction tool based on logic query templates , 2010, FSE '10.

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

[51]  Miryung Kim,et al.  RefDistiller: a refactoring aware code review tool for inspecting manual refactoring edits , 2014, SIGSOFT FSE.

[52]  Lianping Chen,et al.  Continuous Delivery: Huge Benefits, but Challenges Too , 2015, IEEE Software.

[53]  Marco Tulio Valente,et al.  Why we refactor? confessions of GitHub contributors , 2016, SIGSOFT FSE.

[54]  Alessandro Orso,et al.  Scaling regression testing to large software systems , 2004, SIGSOFT '04/FSE-12.

[55]  Per Runeson,et al.  Empirical evaluations of regression test selection techniques: a systematic review , 2008, ESEM '08.

[56]  Augusto Sampaio,et al.  Algebraic reasoning for object-oriented programming , 2004, Sci. Comput. Program..

[57]  Brendan Murphy,et al.  The Art of Testing Less without Sacrificing Quality , 2015, 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.

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

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

[60]  Frank Tip,et al.  Refactoring using type constraints , 2011, TOPL.

[61]  Gregg Rothermel,et al.  Software testing: a research travelogue (2000–2014) , 2014, FOSE.

[62]  Zebao Gao,et al.  Making System User Interactive Tests Repeatable: When and What Should we Control? , 2015, 2016 IEEE International Conference on Software Testing, Verification and Validation (ICST).

[63]  Julien Cohen,et al.  Renaming Global Variables in C Mechanically Proved Correct , 2016, VPT@ETAPS.

[64]  J.M. Stankovic Oracle JDeveloper , 1999, 4th International Conference on Telecommunications in Modern Satellite, Cable and Broadcasting Services. TELSIKS'99 (Cat. No.99EX365).