Skip to main content
Log in

A Brief Review on Multi-objective Software Refactoring and a New Method for Its Recommendation

  • Original Paper
  • Published:
Archives of Computational Methods in Engineering Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12

Similar content being viewed by others

References

  1. Van Vliet H, Van Vliet H, Van Vliet JC (2008) Software engineering: principles and practice, vol 13. Wiley, Citeseer

    MATH  Google Scholar 

  2. Zarnekow R, Brenner W (2005) Distribution of cost over the application lifecycle—a multi-case study. In: ECIS 2005 proceedings, p 26

  3. Dehaghani SMH, Hajrahimi N (2013) Which factors affect software projects maintenance cost more? Acta Inform Med 21(1):63

    Google Scholar 

  4. 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

    Google Scholar 

  5. 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

  6. Brown WH, Malveau RC, McCormick HW, Mowbray TJ (1998) Antipatterns: refactoring software, architectures, and projects in crisis. Wiley, New York

    Google Scholar 

  7. 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

  8. Fowler M (2018) Refactoring: improving the design of existing code. Addison-Wesley Professional, Boston

    MATH  Google Scholar 

  9. Opdyke WF (1992) Refactoring: a program restructuring aid in designing object-oriented application frameworks. PhD thesis, University of Illinois at Urbana-Champaign

  10. 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

  11. 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

  12. O’Keeffe M, Cinnéide MO (2008) Search-based refactoring for software maintenance. J Syst Softw 81(4):502–516

    Google Scholar 

  13. 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

  14. 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

    Google Scholar 

  15. 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

  16. 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

  17. 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

    Google Scholar 

  18. 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

  19. 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

  20. Booch G (2006) Object oriented analysis and design with application. Pearson Education India, New Delhi

    MATH  Google Scholar 

  21. Fontana FA, Braione P, Zanoni M (2012) Automatic detection of bad smells in code: an experimental assessment. J Object Technol 11(2):1–5

    Google Scholar 

  22. Mens T, Tourwé T (2004) A survey of software refactoring. IEEE Trans Softw Eng 30(2):126–139

    Google Scholar 

  23. Han A-R, Bae D-H (2013) Dynamic profiling-based approach to identifying cost-effective refactorings. Inf Softw Technol 55(6):966–985

    Google Scholar 

  24. Kaur S, Singh P (2019) How does object-oriented code refactoring influence software quality? Research landscape and challenges. J Syst Softw 157:110394

    Google Scholar 

  25. Eclipse. https://eclipse.org/

  26. 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

    Google Scholar 

  27. 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

    Google Scholar 

  28. Zitzler E, Laumanns M, Thiele L (2001) Spea2: Improving the strength pareto evolutionary algorithm. TIK-report, p 103

  29. 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

  30. 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

  31. 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

    Google Scholar 

  32. Zhang Q, Li H (2007) Moea/d: a multiobjective evolutionary algorithm based on decomposition. IEEE Trans Evol Comput 11(6):712–731

    Google Scholar 

  33. Angus D, Woodward C (2009) Multiple objective ant colony optimisation. Swarm Intell 3(1):69–85

    Google Scholar 

  34. Zitzler E, Thiele L (1998) An evolutionary algorithm for multiobjective optimization: the strength pareto approach. TIK-report, p 43

  35. 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

  36. Srinivas N, Deb K (1994) Muiltiobjective optimization using nondominated sorting in genetic algorithms. Evol Comput 2(3):221–248

    Google Scholar 

  37. 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

  38. 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

    MathSciNet  MATH  Google Scholar 

  39. 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

    Google Scholar 

  40. Niu B, Wang H, Wang J, Tan L (2013) Multi-objective bacterial foraging optimization. Neurocomputing 116:336–345

    Google Scholar 

  41. Pyari Mohan Pradhan and Ganapati Panda (2012) Solving multiobjective problems using cat swarm optimization. Expert Syst Appl 39(3):2956–2964

    Google Scholar 

  42. Yang X-S (2012) Bat algorithm for multi-objective optimisation. Int J BioInspired Comput

  43. Wolpert DH, Macready WG (1997) No free lunch theorems for optimization. IEEE Trans Evol Comput 1(1):67–82

    Google Scholar 

  44. 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

  45. Ouni A, Kessentini M, Sahraoui H (2014) Multiobjective optimization for software refactoring and evolution. In: Advances in computers, vol 94. Elsevier, pp 103–167

  46. 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

    Google Scholar 

  47. 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

    Google Scholar 

  48. 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

  49. 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

  50. 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

  51. 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

  52. 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

    Google Scholar 

  53. Li X (2003) A non-dominated sorting particle swarm optimizer for multiobjective optimization. In: Genetic and evolutionary computation conference. Springer, pp 37–48

  54. 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

  55. Bandarua S, Debb K (2016) Metaheuristic techniques. In: Decision sciences: theory and practice, pp 693–750

  56. 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

    MathSciNet  MATH  Google Scholar 

  57. 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

  58. Timothy Marler R, Arora JS (2004) Survey of multi-objective optimization methods for engineering. Struct Multidiscip Optim 26(6):369–395

    MathSciNet  MATH  Google Scholar 

  59. Deb K (2014) Multi-objective optimization. In: Search methodologies. Springer, pp 403–449

  60. 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

    Google Scholar 

  61. Edgeworth FY (1881) Mathematical physics. Keagan, London

    Google Scholar 

  62. Pareto V (1964) Cours d’economie politique: Librairie Dro

  63. 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

    Google Scholar 

  64. Dhiman G, Kumar V (2017) Spotted hyena optimizer: a novel bio-inspired based metaheuristic technique for engineering applications. Adv Eng Softw 114:48–70

    Google Scholar 

  65. 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

  66. 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

    Google Scholar 

  67. Coello CAC, Pulido GT, Lechuga MS, Salazar M (2004) Handling multiple objectives with particle swarm optimization. IEEE Trans Evol Comput 8(3):256–279

    Google Scholar 

  68. Knowles JD, Corne DW (2000) Approximating the nondominated front using the pareto archived evolution strategy. Evol Comput 8(2):149–172

    Google Scholar 

  69. inFusion. http://www.intooitus.com/products/infusion

  70. 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

  71. GanttProject. http://ganttproject.biz/index.php

  72. JHotDraw. http://jhotdraw.org/

  73. orDrumbox. http://sourceforge.net/ordrumbox

  74. HealthWatcher. http://ptolemy.cs.iastate.edu/design-study/#health watcher

  75. Xerces-J. http://xerces.apache.org/xerces-j/

  76. Coello CAC, Dhaenens C, Jourdan L (2010) Multi-objective combinatorial optimization: problematic and context. Springer, Berlin, pp 1–21

    MATH  Google Scholar 

  77. 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

    Google Scholar 

  78. 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

    MathSciNet  MATH  Google Scholar 

  79. Li M, Zheng J (2009) Spread assessment for evolutionary multi-objective optimization. Springer, Berlin, pp 216–230

    Google Scholar 

  80. 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

    Google Scholar 

  81. Knowles JD, Thiele L, Zitzler E (2006) A tutorial on the performance assessment of stochastic multiobjective optimizers. TIK-report, p 214

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Satnam Kaur.

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

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11831-020-09491-5

Keywords

Navigation