On the use of design defect examples to detect model refactoring opportunities

Abstract Design defects are symptoms of design decay, which can lead to several maintenance problems. To detect these defects, most of existing research is based on the definition of rules that represent a combination of software metrics. These rules are sometimes not enough to detect design defects since it is difficult to find the best threshold values; the rules do not take into consideration the programming context, and it is challenging to find the best combination of metrics. As an alternative, we propose in this paper to identify design defects using a genetic algorithm based on the similarity/distance between the system under study and a set of defect examples without the need to define detection rules. We tested our approach on four open-source systems to identify three potential design defects. The results of our experiments confirm the effectiveness of the proposed approach.

[1]  Marouane Kessentini,et al.  Search-based detection of high-level model changes , 2012, 2012 28th IEEE International Conference on Software Maintenance (ICSM).

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

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

[4]  Martin Fowler,et al.  Refactoring - Improving the Design of Existing Code , 1999, Addison Wesley object technology series.

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

[6]  David Lo,et al.  Automated Detection of Likely Design Flaws in N-Tier Architectures , 2011, SEKE.

[7]  Houari A. Sahraoui,et al.  Deviance from perfection is a better criterion than closeness to evil when identifying risky code , 2010, ASE.

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

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

[10]  Jeffrey G. Gray,et al.  Generic and Domain-Specific Model Refactoring Using a Model Transformation Engine , 2005, Model-Driven Software Development.

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

[12]  Derrick G. Kourie,et al.  Towards proving preservation of behaviour of refactoring of UML models , 2005 .

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

[14]  Houari A. Sahraoui,et al.  Search-Based Design Defects Detection by Example , 2011, FASE.

[15]  Claus Lewerentz,et al.  Applying design-metrics to object-oriented frameworks , 1996, Proceedings of the 3rd International Software Metrics Symposium.

[16]  David E. Goldberg,et al.  Genetic Algorithms in Search Optimization and Machine Learning , 1988 .

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

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

[19]  Mario Piattini,et al.  Empirical validation of class diagram metrics , 2002, Proceedings International Symposium on Empirical Software Engineering.

[20]  Marouane Kessentini,et al.  Detecting model refactoring opportunities using heuristic search , 2011, CASCON.

[21]  Hafedh Mili,et al.  Understanding design patterns — what is the problem? , 2012, Softw. Pract. Exp..

[22]  Radu Marinescu,et al.  Detection strategies: metrics-based rules for detecting design flaws , 2004, 20th IEEE International Conference on Software Maintenance, 2004. Proceedings..

[23]  Houari A. Sahraoui,et al.  Détection d'anomalies utilisant un langage de règle de qualité , 2006, LMO.

[24]  Tom Mens,et al.  A formal approach to model refactoring and model refinement , 2007, Software & Systems Modeling.

[25]  Bashar Nuseibeh,et al.  Signing Off: The State of the Journal , 2014, IEEE Trans. Software Eng..

[26]  H. Sahraoui,et al.  Model Transformation as an Optimization Problem , 2008, MoDELS.

[27]  Gabriele Bavota,et al.  Detecting bad smells in source code using change history information , 2013, 2013 28th IEEE/ACM International Conference on Automated Software Engineering (ASE).

[28]  Jan Verelst,et al.  Refactoring - improving coupling and cohesion of existing code , 2004, 11th Working Conference on Reverse Engineering.

[29]  Houari A. Sahraoui,et al.  A Cooperative Parallel Search-Based Software Engineering Approach for Code-Smells Detection , 2014, IEEE Transactions on Software Engineering.

[30]  Shari Lawrence Pfleeger,et al.  Software Metrics : A Rigorous and Practical Approach , 1998 .

[31]  John R. Koza,et al.  Genetic programming - on the programming of computers by means of natural selection , 1993, Complex adaptive systems.