Efficient refactoring scheduling based on partial order reduction

Abstract Anti-patterns are poor solutions to design problems that make software systems hard to understand and to extend. Components involved in anti-patterns are reported to be consistently related to high changes and faults rates. Developers are advised to perform refactoring to remove anti-patterns, and consequently improve software design quality and reliability. However, since the number of anti-patterns in a system can be very large, the process of manual refactoring can be overwhelming. To assist a software engineer who has to perform this task, we propose a novel approach RePOR (Refactoring approach based on Partial Order Reduction). We perform a case study with five open source systems to assess the performance of RePOR against two well-known metaheuristics (Genetic Algorithm, and Ant Colony Optimization), one conflict-aware refactoring approach and, a new approach based on sampling ( Sway ). Results show that RePOR can correct a median of 73% of anti-patterns (10% more than existing approaches) with a significant reduction in effort (measured by the number of refactorings applied) ranging from 69% to 85%, and a reduction of execution time ranging between 50% and 87%, in comparison to existing approaches.

[1]  John H. Holland,et al.  Adaptation in Natural and Artificial Systems: An Introductory Analysis with Applications to Biology, Control, and Artificial Intelligence , 1992 .

[2]  L. Darrell Whitley,et al.  An overview of evolutionary algorithms: practical issues and common pitfalls , 2001, Inf. Softw. Technol..

[3]  Tim Menzies,et al.  “Sampling” as a Baseline Optimizer for Search-Based Software Engineering , 2016, IEEE Transactions on Software Engineering.

[4]  Foutse Khomh,et al.  An exploratory study of the impact of antipatterns on class change- and fault-proneness , 2011, Empirical Software Engineering.

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

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

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

[8]  Gabriele Bavota,et al.  Do They Really Smell Bad? A Study on Developers' Perception of Bad Code Smells , 2014, 2014 IEEE International Conference on Software Maintenance and Evolution.

[9]  P. Gács,et al.  Algorithms , 1992 .

[10]  Mark Kent O'Keeffe,et al.  Search-based software maintenance , 2006, Conference on Software Maintenance and Reengineering (CSMR'06).

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

[12]  Foutse Khomh,et al.  On the use of developers' context for automatic refactoring of software anti-patterns , 2017, J. Syst. Softw..

[13]  Foutse Khomh,et al.  A Bayesian Approach for the Detection of Code and Design Smells , 2009, 2009 Ninth International Conference on Quality Software.

[14]  M. Kendall A NEW MEASURE OF RANK CORRELATION , 1938 .

[15]  Stefan Edelkamp,et al.  Partial Order Reduction in Directed Model Checking , 2002, SPIN.

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

[17]  Iman Hemati Moghadam,et al.  Resolving Conflict and Dependency in Refactoring to a Desired Design , 2015, e Informatica Softw. Eng. J..

[18]  N. Cliff Ordinal methods for behavioral data analysis , 1996 .

[19]  Foutse Khomh,et al.  Finding the Best Compromise Between Design Quality and Testing Effort During Refactoring , 2016, 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER).

[20]  David E. Goldberg,et al.  Genetic Algorithms, Tournament Selection, and the Effects of Noise , 1995, Complex Syst..

[21]  Yann-Gaël Guéhéneuc,et al.  DeMIMA: A Multilayered Approach for Design Pattern Identification , 2008, IEEE Transactions on Software Engineering.

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

[23]  Tom Mens,et al.  Analysing refactoring dependencies using graph transformation , 2007, Software & Systems Modeling.

[24]  Yann-Gaël Guéhéneuc,et al.  Recovering binary class relationships: putting icing on the UML cake , 2004, OOPSLA.

[25]  Doo-Hwan Bae,et al.  Automated scheduling for clone‐based refactoring using a competent GA , 2011, Softw. Pract. Exp..

[26]  Zhendong Niu,et al.  Schedule of Bad Smell Detection and Resolution: A New Way to Save Effort , 2012, IEEE Transactions on Software Engineering.

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

[28]  Dan Boneh,et al.  On genetic algorithms , 1995, COLT '95.

[29]  Deepak Goyal,et al.  A hierarchical model for object-oriented design quality assessment , 2015 .

[30]  Giuliano Antoniol,et al.  A novel approach to optimize clone refactoring activity , 2006, GECCO.

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

[32]  Tim Menzies,et al.  Data Mining Static Code Attributes to Learn Defect Predictors , 2007, IEEE Transactions on Software Engineering.

[33]  Yann-Gaël Guéhéneuc,et al.  DECOR: A Method for the Specification and Detection of Code and Design Smells , 2010, IEEE Transactions on Software Engineering.

[34]  Foutse Khomh,et al.  An Empirical Study of the Impact of Two Antipatterns, Blob and Spaghetti Code, on Program Comprehension , 2011, 2011 15th European Conference on Software Maintenance and Reengineering.

[35]  Leon Moonen,et al.  Java quality assurance by detecting code smells , 2002, Ninth Working Conference on Reverse Engineering, 2002. Proceedings..

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

[37]  Tom Mens,et al.  Does God Class Decomposition Affect Comprehensibility? , 2006, IASTED Conf. on Software Engineering.

[38]  Yann-Gaël Guéhéneuc Ptidej : Promoting Patterns with Patterns , 2005 .

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

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

[41]  R. Yin Case Study Research: Design and Methods , 1984 .

[42]  Foutse Khomh,et al.  Exact search-space size for the refactoring scheduling problem , 2017, Automated Software Engineering.

[43]  Troh Josselin Dea Improving the Performance of Many-Objective Software Refactoring Technique Using Dimensionality Reduction , 2016, SSBSE.

[44]  Guillaume Fertin,et al.  Sorting by Transpositions Is Difficult , 2010, SIAM J. Discret. Math..

[45]  G. Li,et al.  Conflict-aware schedule of software refactorings , 2008, IET Softw..

[46]  Marco Dorigo,et al.  Ant system: optimization by a colony of cooperating agents , 1996, IEEE Trans. Syst. Man Cybern. Part B.

[47]  David Lorge Parnas,et al.  Software aging , 1994, Proceedings of 16th International Conference on Software Engineering.

[48]  Christopher L. Simons,et al.  Interactive ant colony optimization (iACO) for early lifecycle software design , 2012, Swarm Intelligence.

[49]  Antonio J. Nebro,et al.  jMetal: A Java framework for multi-objective optimization , 2011, Adv. Eng. Softw..

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

[51]  Boni García,et al.  SERIOUS: Software Evolution, Refactoring, Improvement of Operational  and Usable Systems , 2009, 2009 13th European Conference on Software Maintenance and Reengineering.

[52]  Beat Kleiner,et al.  Graphical Methods for Data Analysis , 1983 .

[53]  Mohamed Wiem Mkaouer,et al.  Recommendation system for software refactoring using innovization and interactive dynamic optimization , 2014, ASE.

[54]  David Thomas,et al.  The Art in Computer Programming , 2001 .

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

[56]  D. Wolfe,et al.  Nonparametric Statistical Methods. , 1974 .

[57]  Chanchal Kumar Roy,et al.  A Constraint Programming Approach to Conflict-Aware Optimal Scheduling of Prioritized Code Clone Refactoring , 2011, 2011 IEEE 11th International Working Conference on Source Code Analysis and Manipulation.

[58]  Darrell Whitley,et al.  A genetic algorithm tutorial , 1994, Statistics and Computing.