Using a many-objective approach to investigate automated refactoring

Abstract Context Software maintenance is expensive and so anything that can be done to reduce its cost is potentially of huge benefit. However, it is recognised that some maintenance, especially refactoring, can be automated. Given the number of possible refactorings and combinations of refactorings, a search-based approach may provide the means to optimise refactorings. Objective This paper describes the investigation of a many-objective genetic algorithm used to automate software refactoring, implemented as a Java tool, MultiRefactor. Method The approach and tool is evaluated using a set of open source Java programs. The tool contains four separate measures of software looking at the software quality as well as measures of code priority, refactoring coverage and element recentness. The many-objective algorithm combines the four objectives to improve the software in a holistic manner. An experiment has been constructed to compare the many-objective approach against a mono-objective approach that only uses a single objective to measure software quality. Different permutations of the objectives are also tested and compared to see how well the different objectives can work together in a multi-objective refactoring approach. The eight approaches are tested on six different open source Java programs. Results The many-objective approach is found to give better objective scores on average than the mono-objective approach and in less time. However, the priority and element recentness objectives are both found to be less successful in multi/many-objective setups when they are used together. Conclusion A many-objective approach is suitable and effective for optimising automated refactoring to improve quality. Including other objectives does not unduly degrade the quality improvements, but is less effective for those objectives than if they were used in a mono-objective approach.

[1]  Mel O Cinn eide Automated application of design patterns: a refactoring approach , 2001 .

[2]  Outi Räihä,et al.  A survey on search-based software design , 2010, Comput. Sci. Rev..

[3]  Houari A. Sahraoui,et al.  The use of development history in software refactoring using a multi-objective evolutionary algorithm , 2013, GECCO '13.

[4]  Mohamed Wiem Mkaouer,et al.  A robust multi-objective approach to balance severity and importance of refactoring opportunities , 2017, Empirical Software Engineering.

[5]  Sergio Segura,et al.  SIP: Optimal Product Selection from Feature Models Using Many-Objective Evolutionary Optimization , 2016, ACM Trans. Softw. Eng. Methodol..

[6]  Kalyanmoy Deb,et al.  A fast and elitist multiobjective genetic algorithm: NSGA-II , 2002, IEEE Trans. Evol. Comput..

[7]  Katsuro Inoue,et al.  Multi-Criteria Code Refactoring Using Search-Based Software Engineering , 2016, ACM Trans. Softw. Eng. Methodol..

[8]  Mark Harman,et al.  Evolving transformation sequences using genetic algorithms , 2004, Source Code Analysis and Manipulation, Fourth IEEE International Workshop on.

[9]  Carl G. Davis,et al.  A Hierarchical Model for Object-Oriented Design Quality Assessment , 2002, IEEE Trans. Software Eng..

[10]  Yuanyuan Zhang,et al.  Search-based software engineering: Trends, techniques and applications , 2012, CSUR.

[11]  Abdel Salam Sayyad,et al.  Pareto-optimal search-based software engineering (POSBSE): A literature survey , 2013, 2013 2nd International Workshop on Realizing Artificial Intelligence Synergies in Software Engineering (RAISE).

[12]  C. Izurieta,et al.  TrueRefactor : An Automated Refactoring Tool to Improve Legacy System and Application Comprehensibility , 2011 .

[13]  Des Greer,et al.  MultiRefactor: Automated Refactoring To Improve Software Quality , 2017, PROFES.

[14]  Xuan Liu,et al.  Supporting Many-Objective Software Requirements Decision: An Exploratory Study on the Next Release Problem , 2018, IEEE Access.

[15]  Des Greer,et al.  Technical debt reduction using search based automated refactoring , 2016, J. Syst. Softw..

[16]  Mohamed Wiem Mkaouer,et al.  High dimensional search-based software engineering: finding tradeoffs among 15 objectives for automating software refactoring using NSGA-III , 2014, GECCO.

[17]  Wenhua Zeng,et al.  Reducing the run-time complexity of NSGA-II for bi-objective optimization problem , 2010, 2010 IEEE International Conference on Intelligent Computing and Intelligent Systems.

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

[19]  Soon-Thiam Khu,et al.  An Investigation on Preference Order Ranking Scheme for Multiobjective Evolutionary Optimization , 2007, IEEE Transactions on Evolutionary Computation.

[20]  Lothar Thiele,et al.  A Preference-Based Evolutionary Algorithm for Multi-Objective Optimization , 2009, Evolutionary Computation.

[21]  Houari A. Sahraoui,et al.  Search-Based Refactoring Using Recorded Code Changes , 2013, 2013 17th European Conference on Software Maintenance and Reengineering.

[22]  Atanas Rountev,et al.  Automated Refactoring of Legacy Java Software to Enumerated Types , 2007, 2007 IEEE International Conference on Software Maintenance.

[23]  Mel Ó Cinnéide,et al.  Journal of Software Maintenance and Evolution: Research and Practice Search-based Refactoring: an Empirical Study , 2022 .

[24]  Qingfu Zhang,et al.  MOEA/D: A Multiobjective Evolutionary Algorithm Based on Decomposition , 2007, IEEE Transactions on Evolutionary Computation.

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

[26]  Betty H. C. Cheng,et al.  On the use of genetic programming for automated refactoring and the introduction of design patterns , 2010, GECCO '10.

[27]  John A. Clark,et al.  Searching for resource-efficient programs: low-power pseudorandom number generators , 2008, GECCO '08.

[28]  Alexander Chatzigeorgiou,et al.  JDeodorant: Identification and Removal of Type-Checking Bad Smells , 2008, 2008 12th European Conference on Software Maintenance and Reengineering.

[29]  Katsuro Inoue,et al.  Improving multi-objective code-smells correction using development history , 2015, J. Syst. Softw..

[30]  Tapabrata Ray,et al.  A Pareto Corner Search Evolutionary Algorithm and Dimensionality Reduction in Many-Objective Optimization Problems , 2011, IEEE Transactions on Evolutionary Computation.

[31]  Adnan Shaout,et al.  Many-Objective Software Remodularization Using NSGA-III , 2015, TSEM.

[32]  Mark Harman,et al.  Search-Based Software Project Management , 2014, Software Project Management in a Changing World.

[33]  Márcio de Oliveira Barros,et al.  A Systematic Review of Software Requirements Selection and Prioritization Using SBSE Approaches , 2013, SSBSE.

[34]  Spiros Mancoridis,et al.  Using code metric histograms and genetic algorithms to perform author identification for software forensics , 2007, GECCO '07.

[35]  Mark Harman,et al.  Reformulating software engineering as a search problem , 2003 .

[36]  Houari A. Sahraoui,et al.  Design Defects Detection and Correction by Example , 2011, 2011 IEEE 19th International Conference on Program Comprehension.

[37]  Mohamed Wiem Mkaouer,et al.  Software refactoring under uncertainty: a robust multi-objective approach , 2014, GECCO.

[38]  Massimiliano Di Penta,et al.  Evolution doctor: a framework to control software system evolution , 2005, Ninth European Conference on Software Maintenance and Reengineering.

[39]  Houari A. Sahraoui,et al.  Prioritizing code-smells correction tasks using chemical reaction optimization , 2015, Software Quality Journal.

[40]  Chris F. Kemerer,et al.  A Metrics Suite for Object Oriented Design , 2015, IEEE Trans. Software Eng..

[41]  Phil McMinn,et al.  Search‐based software test data generation: a survey , 2004, Softw. Test. Verification Reliab..

[42]  Marouane Kessentini,et al.  What you like in design use to correct bad-smells , 2012, Software Quality Journal.

[43]  Rodrigo A. Vivanco,et al.  Finding Effective Software Metrics to Classify Maintainability Using a Parallel Genetic Algorithm , 2004, GECCO.

[44]  John E. Dennis,et al.  Normal-Boundary Intersection: A New Method for Generating the Pareto Surface in Nonlinear Multicriteria Optimization Problems , 1998, SIAM J. Optim..

[45]  Günther Ruhe,et al.  Search Based Software Engineering , 2013, Lecture Notes in Computer Science.

[46]  Mark Kent O'Keeffe,et al.  Getting the most from search-based refactoring , 2007, GECCO '07.

[47]  Houari A. Sahraoui,et al.  Search-based refactoring: Towards semantics preservation , 2012, 2012 28th IEEE International Conference on Software Maintenance (ICSM).

[48]  Mark Harman,et al.  Search Based Software Engineering: Techniques, Taxonomy, Tutorial , 2010, LASER Summer School.

[49]  Hürevren Kiliç,et al.  An Empirical Study About Search-Based Refactoring Using Alternative Multiple and Population-Based Search Techniques , 2011, ISCIS.

[50]  Houari A. Sahraoui,et al.  Maintainability defects detection and correction: a multi-objective approach , 2013, Automated Software Engineering.

[51]  Jerffeson Teixeira de Souza,et al.  The Human Competitiveness of Search Based Software Engineering , 2010, 2nd International Symposium on Search Based Software Engineering.

[52]  Mark Harman,et al.  The Current State and Future of Search Based Software Engineering , 2007, Future of Software Engineering (FOSE '07).

[53]  Marouane Kessentini,et al.  On the Use of Machine Learning and Search-Based Software Engineering for Ill-Defined Fitness Function: A Case Study on Software Refactoring , 2014, SSBSE.

[54]  Mohamed Wiem Mkaouer,et al.  On the use of many quality attributes for software refactoring: a many-objective search-based software engineering approach , 2016, Empirical Software Engineering.

[55]  Iman Hemati Moghadam,et al.  Code-Imp: a tool for automated search-based refactoring , 2011, WRT '11.

[56]  Abdelkarim Erradi,et al.  Example-based Design Defects Detection and Correction , 2011 .

[57]  Des Greer,et al.  A survey of search-based refactoring for software maintenance , 2018, Journal of Software Engineering Research and Development.

[58]  Terry Van Belle,et al.  Code Factoring And The Evolution Of Evolvability , 2002, GECCO.

[59]  Jan Wloka,et al.  Tool-Supported Discovery and Refactoring of Structural Weaknesses in Code , 2002 .

[60]  Kalyanmoy Deb,et al.  An Evolutionary Many-Objective Optimization Algorithm Using Reference-Point-Based Nondominated Sorting Approach, Part I: Solving Problems With Box Constraints , 2014, IEEE Transactions on Evolutionary Computation.

[61]  Huiqing Li,et al.  Refactoring Support for Modularity Maintenance in Erlang , 2010, 2010 10th IEEE Working Conference on Source Code Analysis and Manipulation.

[62]  Douglas Bell Software Engineering: A Programming Approach , 1987 .

[63]  Mark Harman,et al.  A Theoretical and Empirical Study of Search-Based Testing: Local, Global, and Hybrid Search , 2010, IEEE Transactions on Software Engineering.

[64]  Aurora Trinidad Ramirez Pozo,et al.  Search Based Software Engineering: Review and analysis of the field in Brazil , 2013, J. Syst. Softw..

[65]  Johannes Stammel,et al.  Search-based determination of refactorings for improving the class structure of object-oriented systems , 2006, GECCO.

[66]  Adrian Trifu,et al.  Automated design flaw correction in object-oriented systems , 2004, Eighth European Conference on Software Maintenance and Reengineering, 2004. CSMR 2004. Proceedings..

[67]  Mark Harman,et al.  Pareto optimal search based refactoring at the design level , 2007, GECCO '07.