MORE: A multi‐objective refactoring recommendation approach to introducing design patterns and fixing code smells

  • Ali Ouni
    Graduate School of Information Science and Technology Osaka University Japan
  • Marouane Kessentini
    Department of Computer and Information Science University of Michigan U.S.A.
  • Mel Ó Cinnéide
    School of Computer Science National University of Ireland Dublin Ireland
  • Houari Sahraoui
    Department of Computer Science and Operations Research University of Montreal Canada
  • Kalyanmoy Deb
    Department of Electrical and Computing Engineering Michigan State University U.S.A.
  • Katsuro Inoue
    Graduate School of Information Science and Technology Osaka University Japan

Description

<jats:p>Refactoring is widely recognized as a crucial technique applied when evolving object‐oriented software systems. If applied well, refactoring can improve different aspects of software quality including readability, maintainability, and extendibility. However, despite its importance and benefits, recent studies report that automated refactoring tools are underused much of the time by software developers. This paper introduces an automated approach for refactoring recommendation, called MORE, driven by 3 objectives: (1) to improve design quality (as defined by software quality metrics), (2) to fix code smells, and (3) to introduce design patterns. To this end, we adopt the recent nondominated sorting genetic algorithm, NSGA‐III, to find the best trade‐off between these 3 objectives. We evaluated the efficacy of our approach using a benchmark of 7 medium and large open‐source systems, 7 commonly occurring code smells (god class, feature envy, data class, spaghetti code, shotgun surgery, lazy class, and long parameter list), and 4 common design pattern types (visitor, factory method, singleton, and strategy). Our approach is empirically evaluated through a quantitative and qualitative study to compare it against 3 different state‐of‐the art approaches, 2 popular multiobjective search algorithms, and random search. The statistical analysis of the results confirms the efficacy of our approach in improving the quality of the studied systems while successfully fixing 84% of code smells and introducing an average of 6 design patterns. In addition, the qualitative evaluation shows that most of the suggested refactorings (an average of 69%) are considered by developers to be relevant and meaningful.</jats:p>

Journal

References(72)*help

See more

Related Projects

See more

Report a problem

Back to top