A Multi-Objective Refactoring Approach to Introduce Design Patterns and Fix Anti-Patterns

Refactoring is widely recognized as a crucial technique applied when evolving object-oriented software systems. Refactoring has promised, if applied well, to improve software readability, maintainability and extendibility. In general, to improve software quality, most of existing studies focus on the correction of anti-patterns or enhancing specific quality metrics. However, this may not be sufficient to make the source code easier to understand and modify. The introduction of design patterns that represent good design practices represents an efficient way improve the quality of systems; but very few works consider the use of refactoring to introduce design patterns. We propose, in this paper, an automated multiobjective refactoring recommendation approach to (1) improve design quality (as defined by software quality metrics), (2) fix anti-patterns, and (3) introduce design patterns. To evaluate our approach, we conducted a quantitative and qualitative evaluation using a benchmark composed of four open source systems. The statistical analysis of the results confirms the efficiency of our proposal compared to the state-of-the-art of refactoring approaches.

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

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

[3]  Gabriele Bavota,et al.  Supporting extract class refactoring in Eclipse: The ARIES project , 2012, 2012 34th International Conference on Software Engineering (ICSE).

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

[5]  Ondrej Lhoták,et al.  The Soot framework for Java program analysis: a retrospective , 2011 .

[6]  Eleni Stroulia,et al.  JDeodorant: identification and application of extract class refactorings , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

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

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

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

[10]  Ricardo Terra,et al.  Recommending automated extract method refactorings , 2014, ICPC 2014.

[11]  Andrew P. Black,et al.  Breaking the barriers to successful refactoring: observations and tools for extract method , 2008, ICSE.

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

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

[14]  Gordon Fraser,et al.  Parameter tuning or default values? An empirical investigation in search-based software engineering , 2013, Empirical Software Engineering.

[15]  Friedrich Steimann,et al.  From behaviour preservation to behaviour modification: constraint-based mutant generation , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[16]  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.

[17]  Jean-Claude Royer,et al.  Transformations between Composite and Visitor Implementations in Java , 2013, 2013 39th Euromicro Conference on Software Engineering and Advanced Applications.

[18]  Laurie J. Hendren,et al.  Optimizing Java Bytecode Using the Soot Framework: Is It Feasible? , 2000, CC.

[19]  Mel Ó Cinnéide,et al.  A methodology for the automated introduction of design patterns , 1999, Proceedings IEEE International Conference on Software Maintenance - 1999 (ICSM'99). 'Software Maintenance for Business Change' (Cat. No.99CB36360).

[20]  Emerson R. Murphy-Hill,et al.  BeneFactor: a flexible refactoring tool for eclipse , 2011, OOPSLA Companion.

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

[22]  Mark Kent O'Keeffe,et al.  Search-based refactoring for software maintenance , 2008, J. Syst. Softw..

[23]  Houari A. Sahraoui,et al.  Multiobjective Optimization for Software Refactoring and Evolution , 2014, Adv. Comput..

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

[25]  Reiko Heckel,et al.  Local Search-Based Refactoring as Graph Transformation , 2009, 2009 1st International Symposium on Search Based Software Engineering.

[26]  Akram Ajouli,et al.  Vues et transformations de programmes pour la modularité des évolutions. (Views and program transformations for modular maintenances) , 2013 .

[27]  Andrew P. Black,et al.  Refactoring Tools: Fitness for Purpose , 2008, IEEE Software.

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

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

[30]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

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

[32]  Raed Shatnawi,et al.  An empirical study of the bad smells and class error probability in the post-release object-oriented system evolution , 2007, J. Syst. Softw..

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

[34]  Lionel C. Briand,et al.  A practical guide for using statistical tests to assess randomized algorithms in software engineering , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[35]  Thomas J. Mowbray,et al.  AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis , 1998 .

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

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

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

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

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

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

[42]  Mika Mäntylä,et al.  A taxonomy and an initial empirical study of bad smells in code , 2003, International Conference on Software Maintenance, 2003. ICSM 2003. Proceedings..