170 likes | 199 Views
Simultaneous Search-Based Genetic Transfer Across Refactoring and Regression Testing Tasks. IPIT Research Presentation Jeffrey J. Yackley 3 June 2019. Co-authors. Jeffrey Yackley, MS Marouane Kessentini, PhD Gabriele Bavota, PhD Vahid Alizadeh, MS Bruce Maxim, PhD. Background.
E N D
Simultaneous Search-Based Genetic Transfer Across Refactoring and Regression Testing Tasks IPIT Research Presentation Jeffrey J. Yackley 3 June 2019
Co-authors Jeffrey Yackley, MS Marouane Kessentini, PhD Gabriele Bavota, PhD Vahid Alizadeh, MS Bruce Maxim, PhD
Background • Regression Testing • Testing to ensure recent changes have not introduced bugs in to the existing code • Refactoring • Changing the internal structure of existing code in order to improve software quality without changing the external behavior of the code Image Source: http://www.moniro.com/products/services/software-refactoring.html
Correlation between Refactoring and Regression Testing • 3 Reasons Connected: • Refactoring is not supposed to change system behavior • Thus regression testing should be performed on refactored code • Both must first identify the code to either refactor or test • Developers interested in refactoring buggy code to improve the maintainability (Kim 2014) • Regression tests therefore leads to refactoring
Motivating Example • Aspect-J Project • Open-source AOP extension to Java • Releases between 03/2002 and 01/2014 • AjcTask Class • 28 bugs over several releases • Code smells average between 9 and 14 Conclusions: • Refactoring can introduce bugs • Code smells may be related to high class fault proneness
Hypothesis Unification and transfer learning across refactoring and regression testing improves simultaneously software quality and efficiency of defect detection.
Proposed Remedy for Gap in Knowledge • Unified and generic solution representation for • Regression Testing and Refactoring • Serves as common platform for knowledge transfer between the two tasks • Based on multitasking optimization • Exploits relationships between multiple tasks • Simultasking Algorithm based on NSGA-II (Deb 2002) and Evolutionary Multitasking (Gupta 2016) • Works with the concept of a skill factor (for each task) on a single population of individuals
MO-MFO Algorithm • Based on NSGA-II • Addition of skill factor • Representation of an individuals cultural background • Assigned via imitation • Occurs when parents with different skill factors undergo genetic recombination
Validation • RQ1-A: Quality Improvement • To what extent can our approach improve the quality of software systems as compared to mono-task refactoring techniques? • RQ1-B: Refactoring Meaningfulness • Are the refactorings recommendations produced by MO-MFO meaningful from a developer’s point of view? • How do they compare with those generated by a mono-task technique? • RQ2-A: Synergy between Regression Testing and Refactoring to Support Software Maintenance in Practice • To what extent can MO-MFO support the simultaneous selection of relevant test cases for both refactorings and regular code changes while still finding relevant refactorings in a real world scenario? • RQ2-B: Testing Effort Reduction and Refactoring Coverage • What is the effectiveness of our approach in maximizing the coverage of the recommended refactoring and introduced code changes, while reducing the number of selected test cases?
Validation RQ1-B Developer comment: “That’s a relevant one, I spent days fixing one of the bugs located there so I like this extract class and move method. It may probably take e less time in the future to fix future bugs in that class after your recommendation to split it and move some methods out of it.”