Abstract
Search-Based Software Engineering (SBSE) has been used to automate various aspects of the software development cycle. One particular case is refactoring, especially to improve software quality. However, often there are other factors that influence the refactoring process. One such factor, the recentness of the code elements, is identified in this paper as important. The paper describes the use of a multi-objective genetic algorithm to automate software refactoring based on a metric function for software quality and a second objective to measure the recentness of the code elements being refactored. The recentness measure is calculated from data on previous versions of the software. The multi-objective setup refactors the input program to improve its quality using the quality objective, while also focusing on the recentness of the code elements inspected. The approach is implemented in a tool, MultiRefactor and validated using a set of six open source Java programs. An experiment is described that compares the multi-objective approach against an alternative mono-objective approach that uses only the quality function. The results show that the multi-objective approach gives significantly better recentness scores without greatly degrading improvements in the quality score.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsReferences
Bansiya, J., Davis, C.G.: A hierarchical model for object-oriented design quality assessment. IEEE Trans. Softw. Eng. 28(1), 4–17 (2002)
Chidamber, S.R., Kemerer, C.F.: A metrics suite for object oriented design. IEEE Trans. Softw. Eng. 20(6), 476–493 (1994)
Deb, K., Jain, H.: An evolutionary many-objective optimization algorithm using reference-point based non-dominated sorting approach, part I: solving problems with box constraints. IEEE Trans. Evol. Comput. 18(4), 1–23 (2013)
Fowler, M.: Refactoring: Improving the Design of Existing Code. Addison Wesley, Boston (1999)
Griffith, I., Wahl, S., Izurieta, C.: TrueRefactor: an automated refactoring tool to improve legacy system and application comprehensibility. In: 24th International Conference on Computer Applications in Industry and Engineering (ISCA), pp. 35–42 (2011)
Kessentini, M., Kessentini, W., Erradi, A.: Example-based design defects detection and correction. In: Proceedings of 19th International Conference on Program Comprehension, ICPC 2011, pp. 1–32 (2011)
Kim, M., Gee, M., Loh, A., Rachatasumrit, N.: Ref-finder: a refactoring reconstruction tool based on logic query templates. In: Proceedings International Symposium on Foundations of Software Engineering, FSE 2010, pp. 371–372 (2010)
Koc, E., Ersoy, N., Andac, A., Camlidere, Z.S., Cereci, I., Kilic, H.: An empirical study about search-based refactoring using alternative multiple and population-based search techniques. In: Gelenbe, E., Lent, R., Sakellari, G. (eds.) Computer and Information Sciences II, pp. 59–66. Springer, London (2011). https://doi.org/10.1007/978-1-4471-2155-8_7
Mkaouer, M.W., Kessentini, M., Bechikh, S., Cinnéide, M.Ó., Deb, K.: On the use of many quality attributes for software. Empir. Softw. Eng. 21, 2503–2545 (2015)
Mkaouer, M.W., Kessentini, M., Cinnéide, M.Ó., Hayashi, S., Deb, K.: A robust multi-objective approach to balance severity and importance of refactoring opportunities. Empir. Softw. Eng. 22(2), 894–927 (2016)
Mkaouer, M.W., Kessentini, M., Bechikh, S., Deb, K., Cinnéide, M.Ó.: High dimensional search-based software engineering: finding tradeoffs among 15 objectives for automating software refactoring using NSGA-III. In: Genetic and Evolutionary Computation Conference (GECCO), pp. 1263–1270 (2014)
Mkaouer, M.W., Kessentini, M., Bechikh, S., Cinnéide, M.Ó., Deb, K.: Software refactoring under uncertainty: a robust multi-objective approach. In: Proceeding of Genetic and Evolutionary Computation Conference, GECCO 2014, pp. 168–183 (2014)
Mkaouer, M.W., et al.: Many-objective software remodularization using NSGA-III. ACM Trans. Softw. Eng. Methodol. 24(3), 17:1–17:45 (2015)
Moghadam, I.H., Cinnéide, M.Ó.: Code-Imp: a tool for automated search-based refactoring. In: Proceedings of 4th Workshop on Refactoring Tools, WRT 2011, pp. 41–44 (2011)
Mohan, M., Greer, D.: MultiRefactor: automated refactoring to improve software quality. In: Felderer, M., Méndez Fernández, D., Turhan, B., Kalinowski, M., Sarro, F., Winkler, D. (eds.) PROFES 2017. LNCS, vol. 10611, pp. 556–572. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-69926-4_46
Mohan, M., Greer, D.: Automated refactoring of software using version history and a code element recentness measure. In: Proceedings of 13th International Conference on Evaluation of Novel Approaches to Software Engineering (ENASE 2018), pp. 455–462 (2018)
Mohan, M., Greer, D., McMullan, P.: Technical debt reduction using search based automated refactoring. J. Syst. Softw. 120, 183–194 (2016)
Ouni, A., Kessentini, M., Sahraoui, H., Hamdi, M.S.: Search-based refactoring: towards semantics preservation. In: Proceedings of 28th IEEE International Conference on Software Maintenance, ICSM 2012, pp. 347–356 (2012)
Ouni, A., Kessentini, M., Sahraoui, H., Boukadoum, M.: Maintainability defects detection and correction: a multi-objective approach. Autom. Softw. Eng. 20(1), 47–79 (2013)
Ouni, A., Kessentini, M., Sahraoui, H., Inoue, K., Hamdi, M.S.: The use of development history in software refactoring using a multi-objective evolutionary algorithm. In: Genetic and Evolutionary Computation Conference (GECCO), pp. 1461–1468 (2013)
Ouni, A., Kessentini, M., Sahraoui, H., Hamdi, M.S.: Improving multi-objective code-smells correction using development history. J. Syst. Softw. 105, 18–39 (2015)
Ouni, A., Kessentini, M., Bechikh, S., Sahraoui, H.: Prioritizing code-smells correction tasks using chemical reaction optimization. Softw. Qual. J. 23(2), 323–361 (2015)
Ouni, A., Kessentini, M., Sahraoui, H., Inoue, K., Deb, K.: Multi-criteria code refactoring using search-based software engineering: an industrial case study. ACM Trans. Softw. Eng. Methodol. 25(3) (2016)
Ouni, A., Kessentini, M., Sahraoui, H.: Search-based refactoring using recorded code changes. In: Proceedings of European Conference on Software Maintenance and Reengineering (CSMR), pp. 221–230 (2013)
Pérez, J., Murgia, A., Demeyer, S.: A proposal for fixing design smells using software refactoring history. In: Proceedings of International Workshop on Refactoring and Testing, RefTest, pp. 1–4 (2013)
Soetens, Q.D., Demeyer, S.: ChEOPSJ: change-based test optimization. In: Proceedings of European Conference on Software Maintenance and Reengineering (CSMR), pp. 535–538 (2012)
De Souza, J.T., Maia, C.L., de Freitas, F.G., Coutinho, D.P.: The human competitiveness of search based software engineering. In: Proceedings of 2nd International Symposium on Search-Based Software Engineering (SSBSE), pp. 143–152 (2010)
Trifu, A., Seng, O., Genssler, T.: Automated design flaw correction in object-oriented systems. In: Proceedings of 8th European Conference on Software Maintenance and Reengineering (CSMR), pp. 174–183 (2004)
Tsantalis, N., Chatzigeorgiou, A.: Ranking refactoring suggestions based on historical volatility. In: Proceedings of 15th European Conference on Software Maintenance and Reengineering (CSMR), pp. 25–34 (2011)
Wang, R., Purshouse, R.C., Fleming, P.J.: Preference-inspired coevolutionary algorithms for many-objective optimization. IEEE Trans. Evol. Comput. 17(4), 474–494 (2013)
White, D.R., Clarke, J., Jacob, J., Poulding, S.M.: Searching for resource-efficient programs: low-power pseudorandom number generators. In: Proceedings of Genetic and Evolutionary Computation Conference (GECCO), pp. 1775–1782 (2008)
Acknowledgements
The research for this paper contributes to a PhD project funded by the EPSRC grant EP/M506400/1.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this paper
Cite this paper
Mohan, M., Greer, D. (2019). Automated Multi-objective Refactoring Based on Quality and Code Element Recentness. In: Damiani, E., Spanoudakis, G., Maciaszek, L. (eds) Evaluation of Novel Approaches to Software Engineering. ENASE 2018. Communications in Computer and Information Science, vol 1023. Springer, Cham. https://doi.org/10.1007/978-3-030-22559-9_15
Download citation
DOI: https://doi.org/10.1007/978-3-030-22559-9_15
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-22558-2
Online ISBN: 978-3-030-22559-9
eBook Packages: Computer ScienceComputer Science (R0)