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.








Similar content being viewed by others
References
Alikacem, H., & Sahraoui, H. (2006). Détection d’anomalies utilisant un langage de description de règle de qualité. In actes du 12e colloque LMO.
Ben Fadhel, A., Kessentini M., Langer, P., & Wimmer, M. (2012). Search-based detection of high-level model changes. ICSM, pp 212–221.
Bois, B. D., Demeyer, S., & Verelst, J. (2004). Refactoring improving coupling and cohesion of existing code. In Proceedings of the 11th working conference on reverse engineering, pp. 144–151. IEEE Computer Society.
Brown, J. W., Raphael, C. M., Hays, W., & Thomas, J. M. (1998). AntiPatterns: Refactoring software, architectures, and projects in crisis (p. 336). New York, NY: Wiley.
Budi, A., Lucia, Lo, D., Jiang, L., & Wang, S. (2011). Automated detection of likely design flaws in N-tier architectures. Software Engineering and Knowledge Engineering (SEKE), pp. 613–618.
El Boussaidi, G., & Mili, H. (2011). Understanding design patterns—What is the problem? Software: Practice and Experience. doi:10.1002/spe.1145.
Erni, K., & Lewerentz, C. (1996). Applying design-metrics to object-oriented frameworks. In Proceedings of the 3rd international software metrics symposium, pp. 64–74.
Fenton, N. E., & Pfleeger, A. S. L. (1998). Software metrics: A rigorous and practical approach (2nd ed., p. 656). Boston, MA: PWS Publishing Co.
Fowler, M., & Beck, K. (1999). Refactoring: Improving the design of existing code. In Proceedings of the second XP universe and first agile universe conference on extreme programming and agile methods, (p. 256). Springer.
Genero, M., Piattini, M., & Calero, C. (2002). Empirical validation of class diagram metrics. In Proceedings of the international symposium in empirical software engineering. (2002), pp. 195–203.
Ghannem, A., Kessentini, M., & El-Boussaidi, G. (2011). Detecting model refactoring opportunities using heuristic search. In M. Litoiu, E. Stroulia, & S. MacKay (Eds.) Proceedings of the 2011 conference of the center for advanced studies on collaborative research (CASCON ‘11) pp. 175–187. IBM Corp.: Riverton, NJ, USA.
Goldberg, D. E. (1989). Genetic algorithms in search, optimization and machine learning (p. 372). Boston, MA: Addison-Wesley Longman Publishing Co., Inc.
Harman, M., & Tratt, L. (2007). Pareto optimal search based refactoring at the design level. In Proceedings of the 9th annual conference on genetic and evolutionary computation, (London, England), pp. 1106–1113. 1277176: ACM.
Jensen, A. C., & Cheng, B. H. C. (2010). On the use of genetic programming for automated refactoring and the introduction of design patterns. In Proceedings of the 12th annual conference on genetic and evolutionary computation. (Portland, Oregon, USA), pp. 1341–1348. 1830731: ACM.
Kessentini, W., Kessentini, M., Sahraoui, H., Bechikh, S., & Ouni, A. (2014). A cooperative parallel search-based software engineering approach for code-smells detection. IEEE Transactions on Software Engineering, 40(9), 1.
Kessentini, M., Sahraoui, H., & Boukadoum, M. (2008). Model transformation as an optimization problem. In Proceedings of the 11th international conference on model driven engineering languages and systems. (Toulouse, France), pp. 159–173. Springer.
Kessentini, M., Sahraoui, H., Boukadoum, M., & Wimmer, M. (2011). Search-based design defects detection by example. In Proceedings of the 14th international conference on fundamental approaches to software engineering: part of the joint European conferences on theory and practice of software (Saarbrücken, Germany), pp. 401–415. Springer.
Kessentini, M., Vaucher, S., & Sahraoui, H. (2010). Deviance from perfection is a better criterion than closeness to evil when identifying risky code. In Proceedings of the IEEE/ACM international conference on automated software engineering. (Antwerp, Belgium), pp. 113–122. ACM.
Khomh, F., Vaucher, S., Gueheneuc, Y. G., & Sahraoui, H. (2009). A bayesian approach for the detection of code and design smells. In Proceedings of the 9th international conference on quality software (QSIC) pp. 305–314.
Koza, J. R. (1992). Genetic programming: On the programming of computers by means of natural selection (p. 680). Cambridge, MA, USA: MIT Press.
Marinescu, R. (2004). Detection strategies: Metrics-based rules for detecting design flaws. In Proceedings of the 20th IEEE international conference on software maintenance (ICSM). pp. 350–359.
Mens, T., Taentzer G., & Dirk. (2007). Challenges in model refactoring. In Proceedings of the 1st workshop on refactoring tools University of Berlin.
Moha, N., Gueheneuc, Y. G., Duchien, L., & Le Meur, A. F. (2008). DECOR: A method for the specification and detection of code and design smells. Software Engineering, IEEE Transactions, 36(1), 20–36.
O’Keeffe, M. (2008). Search-based refactoring: An empirical study. Journal of Software: Maintenance and Evolution (JSME), 20, 345–364.
Ouni, A., Kessentini, M., Sahraoui, H., & Boukadoum, M. (2013). Maintainability defects detection and correction: A multi-objective approach. Automated Software Engineering (ASE), 20, 47–79. doi:10.1007/s10515-011-0098-8.
Palomba, F., Bavota, G., Di Penta, M., Oliveto, R., De Lucia, A., & Poshyvanyk, D. (2014). Detecting bad smells in source code using change history information. ASE 2013 pp. 268–278.
Seng, O., Stammel, J., & Burkhart, D. (2006). Search-based determination of refactorings for improving the class structure of object-oriented systems. In Proceedings of the 8th annual conference on genetic and evolutionary computation. (Seattle, Washington, USA), pp. 1909–1916. 1144315: ACM.
Van Der Straeten, R., Jonckers, V., & Mens, T. (2007). A formal approach to model refactoring and model refinement. Software and Systems Modeling (SoSyM), 6, 139–162. doi:10.1007/s10270-006-0025-9.
Van Kempen M., Chaudron M., Kourie, D., & Andrew, B. (2005). Towards proving preservation of behaviour of refactoring of UML models. In Proceedings of the 2005 annual research conference of the south african institute of computer scientists and information technologists on IT research in developing countries (SAICSIT) (South African Institute for Computer Scientists and Information Technologists, Republic of South Africa) (pp. 252–259). 1145703.
Zhang, J., Lin, Y., & Gray, J. (2005). Generic and domain-specific model refactoring using a model transformation engine. In Model-driven Software Development—Research and Practice in Software Engineering (pp. 199–217). doi:10.1007/3-540-28554-7_9.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Ghannem, A., El Boussaidi, G. & Kessentini, M. On the use of design defect examples to detect model refactoring opportunities. Software Qual J 24, 947–965 (2016). https://doi.org/10.1007/s11219-015-9271-9
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11219-015-9271-9