Abstract
Software refactoring is a commonly accepted means of improving the software quality without affecting its observable behaviour. It has gained significant attention from both academia and software industry. Therefore, numerous approaches have been proposed to automate refactoring that consider software quality maximization as their prime objective. However, this objective is not enough to generate good and efficient refactoring sequences as refactoring also involves several other uncertainties related to smell severity, history of applied refactoring activities and class severity. To address these concerns, we propose a multi-objective optimization technique to generate refactoring solutions that maximize the (1) software quality, (2) use of smell severity and (3) consistency with class importance. To this end, we provide a brief review on multi-objective search-based software refactoring and use a multi-objective spotted hyena optimizer (MOSHO) to obtain the best compromise between these three objectives. The proposed approach is evaluated on five open source datasets and its performance is compared with five different well-known state-of-the-art meta-heuristic and non-meta-heuristic approaches. The experimental results exhibit that the refactoring solutions provided by MOSHO are significantly better than other algorithms when class importance and code smell severity scores are used.
Similar content being viewed by others
References
Van Vliet H, Van Vliet H, Van Vliet JC (2008) Software engineering: principles and practice, vol 13. Wiley, Citeseer
Zarnekow R, Brenner W (2005) Distribution of cost over the application lifecycle—a multi-case study. In: ECIS 2005 proceedings, p 26
Dehaghani SMH, Hajrahimi N (2013) Which factors affect software projects maintenance cost more? Acta Inform Med 21(1):63
Ouni A, Kessentini M, Bechikh S, Sahraoui H (2015) Prioritizing code-smells correction tasks using chemical reaction optimization. Softw Qual J 23(2):323–361
Mkaouer MW, Kessentini M, Bechikh S, Deb K, Cinnéide M (2014) High dimensional search-based software engineering: finding tradeoffs among 15 objectives for automating software refactoring using NSGA-III. In: Proceedings of the 2014 annual conference on genetic and evolutionary computation. ACM, pp 1263–1270
Brown WH, Malveau RC, McCormick HW, Mowbray TJ (1998) Antipatterns: refactoring software, architectures, and projects in crisis. Wiley, New York
Yamashita A, Moonen L (2012) Do code smells reflect important maintainability aspects? In: 2012 28th IEEE international conference on software maintenance (ICSM). IEEE, pp 306–315
Fowler M (2018) Refactoring: improving the design of existing code. Addison-Wesley Professional, Boston
Opdyke WF (1992) Refactoring: a program restructuring aid in designing object-oriented application frameworks. PhD thesis, University of Illinois at Urbana-Champaign
Ouni A, Kessentini M, Sahraoui H, Hamdi MS (2011) Design defects detection and correction by example. In: 2011 IEEE international conference on program comprehension (ICPC). IEEE, pp. 81–90
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. ACM, pp 1106–1113
O’Keeffe M, Cinnéide MO (2008) Search-based refactoring for software maintenance. J Syst Softw 81(4):502–516
Mkaouer MW, Kessentini M, Bechikh S, Cinnéide M (2014) A robust multi-objective approach for software refactoring under uncertainty. In: International symposium on search based software engineering. Springer, pp 168–183
Ouni A, Kessentini M, Sahraoui H, Boukadoum M (2013) Maintainability defects detection and correction: a multi-objective approach. Autom Softw Eng 20(1):47–79
Ouni A, Kessentini M, Sahraoui H, Hamdi MS (2012) Search-based refactoring: towards semantics preservation. In: 2012 28th IEEE international conference on software maintenance (ICSM). IEEE, pp. 347–356
Ouni A, Kessentini M, Sahraoui H, Hamdi MS (2013) The use of development history in software refactoring using a multi-objective evolutionary algorithm. In: Proceedings of the 15th annual conference on genetic and evolutionary computation. ACM, pp 1461–1468
Ouni A, Kessentini M, Sahraoui H, Inoue K, Hamdi MS (2015) Improving multi-objective code-smells correction using development history. J Syst Softw 105:18–39
Girba T, Ducasse S, Lanza M (2004) Yesterday’s weather: guiding early reverse engineering efforts by summarizing the evolution of changes. In: 20th IEEE international conference on software maintenance, 2004, proceedings. IEEE, pp 40–49
Fokaefs M, Tsantalis N, Chatzigeorgiou A (2007) Jdeodorant: identification and removal of feature envy bad smells. In: 2007 IEEE international conference on software maintenance. IEEE, pp 519–520
Booch G (2006) Object oriented analysis and design with application. Pearson Education India, New Delhi
Fontana FA, Braione P, Zanoni M (2012) Automatic detection of bad smells in code: an experimental assessment. J Object Technol 11(2):1–5
Mens T, Tourwé T (2004) A survey of software refactoring. IEEE Trans Softw Eng 30(2):126–139
Han A-R, Bae D-H (2013) Dynamic profiling-based approach to identifying cost-effective refactorings. Inf Softw Technol 55(6):966–985
Kaur S, Singh P (2019) How does object-oriented code refactoring influence software quality? Research landscape and challenges. J Syst Softw 157:110394
Eclipse. https://eclipse.org/
Zhou A, Qu B-Y, Li H, Zhao S-Z, Suganthan PN, Zhang Q (2011) Multiobjective evolutionary algorithms: a survey of the state of the art. Swarm Evolut Comput 1(1):32–49
Mirjalili S, Saremi S, Mirjalili SM, Coelho LS (2016) Multi-objective grey wolf optimizer: a novel algorithm for multi-criterion optimization. Expert Syst Appl 47:106–119
Zitzler E, Laumanns M, Thiele L (2001) Spea2: Improving the strength pareto evolutionary algorithm. TIK-report, p 103
Corne DW, Jerram NR, Knowles JD, Oates MJ (2001) Pesa-II: region-based selection in evolutionary multiobjective optimization. In: Proceedings of the 3rd annual conference on genetic and evolutionary computation. Morgan Kaufmann Publishers Inc., pp 283–290
Coello CAC, Lechuga MS (2002) Mopso: a proposal for multiple objective particle swarm optimization. In: Proceedings of the 2002 congress on evolutionary computation, CEC’02, pp 1051–1056
Deb K, Pratap A, Agarwal S, Meyarivan TAMT (2002) A fast and elitist multiobjective genetic algorithm: Nsga-II. IEEE Trans Evol Comput 6(2):182–197
Zhang Q, Li H (2007) Moea/d: a multiobjective evolutionary algorithm based on decomposition. IEEE Trans Evol Comput 11(6):712–731
Angus D, Woodward C (2009) Multiple objective ant colony optimisation. Swarm Intell 3(1):69–85
Zitzler E, Thiele L (1998) An evolutionary algorithm for multiobjective optimization: the strength pareto approach. TIK-report, p 43
Corne DW, Knowles JD, Oates MJ (2000) The pareto envelope-based selection algorithm for multiobjective optimization. In: International conference on parallel problem solving from nature. Springer, pp 839–848
Srinivas N, Deb K (1994) Muiltiobjective optimization using nondominated sorting in genetic algorithms. Evol Comput 2(3):221–248
Eberhart R, Kennedy J (1995) A new optimizer using particle swarm theory. In: Proceedings of the sixth international symposium on micro machine and human science, MHS’95. IEEE, pp 39–43
TK Varadharajan and Chandrasekharan Rajendran (2005) A multi-objective simulated-annealing algorithm for scheduling in flowshops to minimize the makespan and total flowtime of jobs. Eur J Oper Res 167(3):772–795
Shang R, Liu H, Jiao L (2017) Multi-objective clustering technique based on k-nodes update policy and similarity matrix for mining communities in social networks. Phys A Stat Mech Appl 486:1–24
Niu B, Wang H, Wang J, Tan L (2013) Multi-objective bacterial foraging optimization. Neurocomputing 116:336–345
Pyari Mohan Pradhan and Ganapati Panda (2012) Solving multiobjective problems using cat swarm optimization. Expert Syst Appl 39(3):2956–2964
Yang X-S (2012) Bat algorithm for multi-objective optimisation. Int J BioInspired Comput
Wolpert DH, Macready WG (1997) No free lunch theorems for optimization. IEEE Trans Evol Comput 1(1):67–82
Ouni A, Kessentini M, Sahraoui H (2013) Search-based refactoring using recorded code changes. In: 2013 17th European conference on software maintenance and reengineering. IEEE, pp 221–230
Ouni A, Kessentini M, Sahraoui H (2014) Multiobjective optimization for software refactoring and evolution. In: Advances in computers, vol 94. Elsevier, pp 103–167
Ouni A, Kessentini M, Sahraoui H, Inoue K, Deb K (2016) Multi-criteria code refactoring using search-based software engineering: an industrial case study. ACM Trans Softw Eng Methodol 25(3):23
Mkaouer MW, Kessentini M, Cinnéide MÓ, Hayashi S, Deb K (2017) A robust multi-objective approach to balance severity and importance of refactoring opportunities. Empirical Softw Eng 22(2):894–927
Mkaouer MW, Kessentini M, Bechikh S, Deb K, Cinnéide M (2014) Recommendation system for software refactoring using innovization and interactive dynamic optimization. In: Proceedings of the 29th ACM/IEEE international conference on automated software engineering. ACM, pp 331–336
Alizadeh V, Kessentini M, Mkaouer W, Ocinneide M, Ouni A, Cai Y (2018) An interactive and dynamic search-based approach to software refactoring recommendations. IEEE Trans Softw Eng
Wang H, Kessentini M, Grosky W, Meddeb H (2015) On the use of time series and search based software engineering for refactoring recommendation. In: Proceedings of the 7th international conference on management of computational and collective intelligence in digital ecosystems. ACM, pp 35–42
Kessentini M, Kessentini W, Sahraoui H, Boukadoum M, Ouni A (2011) Design defects detection and correction by example. In: 2011 IEEE 19th international conference on program comprehension. IEEE, pp 81–90
Zitzler E, Thiele L (1999) Multiobjective evolutionary algorithms: a comparative case study and the strength pareto approach. IEEE Trans Evol Comput 3(4):257–271
Li X (2003) A non-dominated sorting particle swarm optimizer for multiobjective optimization. In: Genetic and evolutionary computation conference. Springer, pp 37–48
Fokaefs M, Tsantalis N, Stroulia E, Chatzigeorgiou A (2011) Jdeodorant: identification and application of extract class refactorings. In: 2011 33rd international conference on software engineering (ICSE). IEEE, pp 1037–1039
Bandarua S, Debb K (2016) Metaheuristic techniques. In: Decision sciences: theory and practice, pp 693–750
Chiandussi G, Codegone M, Ferrero S, Varesio FE (2012) Comparison of multi-objective optimization methodologies for engineering applications. Comput Math Appl 63(5):912–942
Branke J, Deb K, Dierolf H, Osswald M (2004) Finding knees in multi-objective optimization. In: International conference on parallel problem solving from nature. Springer, pp 722–731
Timothy Marler R, Arora JS (2004) Survey of multi-objective optimization methods for engineering. Struct Multidiscip Optim 26(6):369–395
Deb K (2014) Multi-objective optimization. In: Search methodologies. Springer, pp 403–449
Mirjalili SZ, Mirjalili S, Saremi S, Faris H, Aljarah I (2018) Grasshopper optimization algorithm for multi-objective optimization problems. Appl Intell 48(4):805–820
Edgeworth FY (1881) Mathematical physics. Keagan, London
Pareto V (1964) Cours d’economie politique: Librairie Dro
Coello CAC (2009) Evolutionary multi-objective optimization: some current research trends and topics that remain to be explored. Front Comput Sci China 3(1):18–30
Dhiman G, Kumar V (2017) Spotted hyena optimizer: a novel bio-inspired based metaheuristic technique for engineering applications. Adv Eng Softw 114:48–70
Kaur A, Kaur S, Dhiman G (2018) A quantum method for dynamic nonlinear programming technique using schrödinger equation and Monte Carlo approach. Mod Phys Lett B 1850374
Dhiman G, Guo S, Kaur S (2018) Ed-sho: a framework for solving nonlinear economic load power dispatch problem using spotted hyena optimizer. Mod Phys Lett A 33(40):1850239
Coello CAC, Pulido GT, Lechuga MS, Salazar M (2004) Handling multiple objectives with particle swarm optimization. IEEE Trans Evol Comput 8(3):256–279
Knowles JD, Corne DW (2000) Approximating the nondominated front using the pareto archived evolution strategy. Evol Comput 8(2):149–172
Kim M, Gee M, Loh A, Rachatasumrit N (2010) Ref-finder: a refactoring reconstruction tool based on logic query templates. In: Proceedings of the eighteenth ACM SIGSOFT international symposium on Foundations of software engineering. ACM, pp 371–372
GanttProject. http://ganttproject.biz/index.php
JHotDraw. http://jhotdraw.org/
orDrumbox. http://sourceforge.net/ordrumbox
HealthWatcher. http://ptolemy.cs.iastate.edu/design-study/#health watcher
Xerces-J. http://xerces.apache.org/xerces-j/
Coello CAC, Dhaenens C, Jourdan L (2010) Multi-objective combinatorial optimization: problematic and context. Springer, Berlin, pp 1–21
Schutze O, Esquivel X, Lara A, Coello CAC (2012) Using the averaged hausdorff distance as a performance measure in evolutionary multiobjective optimization. IEEE Trans Evol Comput 16(4):504–522
Rudolph G, Schütze O, Grimme C, Domínguez-Medina C, Trautmann H (2016) Optimal averaged hausdorff archives for bi-objective problems: theoretical and numerical results. Comput Optim Appl 64(2):589–618
Li M, Zheng J (2009) Spread assessment for evolutionary multi-objective optimization. Springer, Berlin, pp 216–230
Zitzler E, Thiele L, Laumanns M, Fonseca CM, da Fonseca VG (2003) Performance assessment of multiobjective optimizers: an analysis and review. Trans Evol Comput 7(2):117–132
Knowles JD, Thiele L, Zitzler E (2006) A tutorial on the performance assessment of stochastic multiobjective optimizers. TIK-report, p 214
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
On behalf of all authors, the corresponding author states that there is no conflict of interest.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Kaur, S., Awasthi, L.K. & Sangal, A.L. A Brief Review on Multi-objective Software Refactoring and a New Method for Its Recommendation. Arch Computat Methods Eng 28, 3087–3111 (2021). https://doi.org/10.1007/s11831-020-09491-5
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11831-020-09491-5