Empirical Software Engineering

, Volume 22, Issue 2, pp 894–927 | Cite as

A robust multi-objective approach to balance severity and importance of refactoring opportunities

  • Mohamed Wiem Mkaouer
  • Marouane Kessentini
  • Mel Ó Cinnéide
  • Shinpei Hayashi
  • Kalyanmoy Deb


Refactoring large systems involves several sources of uncertainty related to the severity levels of code smells to be corrected and the importance of the classes in which the smells are located. Both severity and importance of identified refactoring opportunities (e.g. code smells) are difficult to estimate. In fact, due to the dynamic nature of software development, these values cannot be accurately determined in practice, leading to refactoring sequences that lack robustness. In addition, some code fragments can contain severe quality issues but they are not playing an important role in the system. To address this problem, we introduced a multi-objective robust model, based on NSGA-II, for the software refactoring problem that tries to find the best trade-off between three objectives to maximize: quality improvements, severity and importance of refactoring opportunities to be fixed. We evaluated our approach using 8 open source systems and one industrial project, and demonstrated that it is significantly better than state-of-the-art refactoring approaches in terms of robustness in all the experiments based on a variety of real-world scenarios. Our suggested refactoring solutions were found to be comparable in terms of quality to those suggested by existing approaches, better prioritization of refactoring opportunities and to carry an acceptable robustness price.


Search-based software engineering Refactoring under uncertainty Software quality Robust multi-objective optimization 


  1. Anda B (2007) Assessing software system maintainability using structural measures and expert assessments. In: International Conference on Software Maintenance (ICSM), pp 204–213Google Scholar
  2. Antoniol G, Di Penta M, Harman M (2004) A robust search-based approach to project management in the presence of abandonment, rework, error and uncertainty. In METRICS ’04, pp 172–183Google Scholar
  3. Arcuri A, Lionel B (2011) “A practical guide for using statistical tests to assess randomized algorithms in software engineering.” In 33rd International Conference on Software Engineering (ICSE), 2011, pp 1–10. IEEEGoogle Scholar
  4. Bansiya J, Davis CG (2002) A hierarchical model for object-oriented design quality assessment. IEEE Trans Softw Eng 28(1):4–17CrossRefGoogle Scholar
  5. Beyer H-G (2004) Actuator noise in recombinant evolution strategies on general quadratic fitness models. In Genetic and Evolutionary Computation Conference (GECCO), pp 654–665Google Scholar
  6. Beyer H-G, Sendhoff B (2007) Robust optimization – A comprehensive survey. Comput Methods Appl Mech Eng 196(33–34):3190–3218MathSciNetCrossRefzbMATHGoogle Scholar
  7. Brown W-J, Malveau R-C, Brown W-H, Mowbray TJ (1998) Anti Patterns: refactoring Software, Architectures, and Projects in Crisis, 1st edn. WileyGoogle Scholar
  8. Brown W-J, Malveau R, McCormick H-W, Mowbray TJ (1998b) Antipatterns: refactoring software, architectures, and projects in crisis. Wiley, New YorkGoogle Scholar
  9. Brown WJ, Malveau RC, McCormick HW, Mowbray TJ (1998) AntiPatterns: refactoring Software, Architectures, and Projects in Crisis. WileyGoogle Scholar
  10. Chatzigeorgiou A, Manakos A (2013) Investigating the evolution of code smells in object-oriented systems, innovations in systems and software engineering. NASA JGoogle Scholar
  11. Coad P, Yourdon E (1991) Object-oriented design. Yourdon Press, Upper Saddle RiverGoogle Scholar
  12. Coelho W, Murphy G (2007) ClassCompass: a software design men- toring system. Educ Resour Comput 7:1–18Google Scholar
  13. D’Ambros M, Bacchelli A, Lanza M (2010) On the impact of design flaws on software defects In: International Conference on Quality Software, pp 23–31Google Scholar
  14. Das I (2000) Robustness optimization for constrained nonlinear programming problem. Eng Optim 32(5):585–618CrossRefGoogle Scholar
  15. Deb K, Gupta S (2011) Understanding knee points in bi-criteria problems and their implications as preferred solution principles. Eng Optim 43(11):1175–1204MathSciNetCrossRefGoogle Scholar
  16. Deb K, Pratap A, Agarwal S, Meyarivan T (2002) A fast and elitist multiobjective genetic algorithm: NSGA-II. IEEE Trans Evol Comput 6(2):182–197CrossRefGoogle Scholar
  17. Du Bois B, Demeyer S, Verelst J (2004) Refactoring—Improving coupling and cohesion of existing code. In: the Working Conference on Reverse Engineering (WCRE), pp 144–151Google Scholar
  18. Esteves Paixao M-H, De Souza J-T (2013) A scenario-based robust model for the next release problem. In Proceedings of the conference on Genetic and evolutionary computation (GECCO)Google Scholar
  19. Fokaefs M, Tsantalis N, Stroulia E, Chatzigeorgiou A (2011) JDeodorant: identification and application of extract class refactorings. In: Proceedings of the 33rd International Conference on Software Engineering (ICSE ’11). ACM, New York, pp 1037–1039Google Scholar
  20. Fontana FA, Mäntylä MV, Zanoni M, Marino A (2015) Comparing and experimenting machine learning techniques for code smell detection. Empir Softw Eng:1–49Google Scholar
  21. Fowler M, Beck K, Brant J, Opdyke W, Roberts D (1999) Refactoring – Improving the design of existing code, 1st edn Addison-WesleyGoogle Scholar
  22. Glass RL (2001) Frequently forgotten fundamental facts about software engineering. Softw Trends IEEE 18(3):112–111. doi: 10.1109/MS.2001.922739 CrossRefGoogle Scholar
  23. Gueorguiev S, Harman M, Antoniol G (2009) Software project planning for robustness and completion time in the presence of uncertainty using multi objective search based software engineering. In Proceedings of the 11th Annual conference on Genetic and evolutionary computation (GECCO). ACM, New York, pp 1673–1680Google Scholar
  24. Hall T, Zhang M, Bowes D, Sun Y (2014) Some code smells have a significant but small effect on faults. ACM Trans Softw Eng Methodol 23(4), Article 33CrossRefGoogle Scholar
  25. Harman M, Tratt L (2007) Pareto optimal search based refactoring at the design level. In Proceedings of the Genetic and Evolutionary Computation Conference (GECCO’07), pp 1106–1113Google Scholar
  26. Harman M, Mansouri A, Zhang Y (2012) Search-based software engineering: trends, techniques and applications. ACM Comput SurvGoogle Scholar
  27. Jensen A, Cheng B (2010) On the use of genetic programming for automated refactoring and the introduction of design patterns. In Proceedings of the Genetic and Evolutionary Computation Conference (GECCO’10). ACM, New York, pp 1341–1348Google Scholar
  28. Jin Y, Branke J (2005) Evolutionary optimization in uncertain environments – A survey. IEEE Trans Evol Comput 9(3):303–317CrossRefGoogle Scholar
  29. Jin Y, Sendhoff B (2003) Tradeoff between performance and robustness: an evolutionary multiobjective approach. In international conference on Evolutionary Multi-Criterion Optimization (EMO’03), pp 237–251Google Scholar
  30. Kataoka Y, Ernst MD, Griswold WG, Notkin D (2001) Automated support for program refactoring using invariants. In International Conference on Software Maintenance (ICSM’01), pp 736–743Google Scholar
  31. Kerievsky J (2004) Refactoring to patterns. Addison WesleyGoogle Scholar
  32. Kessentini M, Kessentini W, Sahraoui H, Boukadoum M, Ouni A (2011) Design defects detection and correction by example. In: Proceedings of International Conference on Program Comprehension (ICPC), pp 81–90Google Scholar
  33. Li X (2003) A non-dominated sorting particle swarm optimizer for multiobjective optimization. In: The Genetic and Evolutionary Computation Conference (GECCO), pp 37–48Google Scholar
  34. Mäntylä M-V, Lassenius C (2006) Subjective evaluation of software evolvability using code smells: an empirical study. Empir Softw Eng:395–431Google Scholar
  35. Marinescu R (2010) inCode: continuous quality assessment and improvement. In Proceedings of the 14th Conference on Software Maintenance and Reengineering (CSMR)Google Scholar
  36. Mkaouer M-W, Kessentini M, Bechikh S, Ó Cinnéide M (2014) A robust multi-objective approach for software refactoring under uncertainty. In: Symposium on Search Based Software Engineering (SSBSE), pp 168–183Google Scholar
  37. Moghadam IH, Ó Cinnéide M (2012) Automated refactoring using design differencing. In Proceedings of European Conference on Software Maintenance and Reengineering (ECSM’12)Google Scholar
  38. Moha N, Gueheneuc Y-G, Duchien L, Le Meur A-F (2010) DECOR: a method for the specification and detection of code and design smells. IEEE Trans Softw Eng 36(1):20–36CrossRefzbMATHGoogle Scholar
  39. Ó Cinnéide M, Tratt L, Harman M, Counsell S, Moghadam IH (2012) Experimental assessment of software metrics using automated refactoring. In Proceedings of the ESEM’12, pp 49–58Google Scholar
  40. O’Keeffe M, Ó Cinnéide M (2008) Search-based refactoring for software maintenance. J Syst Softw:502–516Google Scholar
  41. Olbrich SM, Cruze DS, Sjøberg DI (2010, September) Are all code smells harmful? A study of god classes and brain classes in the evolution of three open source systems. In Software Maintenance (ICSM), 2010 I.E. International Conference on (pp 1–10). IEEEGoogle Scholar
  42. Oliveto R, Khomh F, Antoniol G, Gue- heneuc Y-G (2010) Numerical signatures of antipatterns: an approach based on B- Splines. In Proc. 14th European Conference on Software Maintenance and Reengineering, pp 248–251Google Scholar
  43. Opdyke WF (1992) Refactoring object-oriented frameworks. Ph.D. Dissertation. University of Illinois at Urbana-Champaign, Champaign. UMI Order No. GAX93-05645Google Scholar
  44. Ouni A, Kessentini M, Sahraoui H, Boukadoum M (2012) Maintainability defects detection and correction: a multi-objective approach. J Autom Softw Eng:47–79Google Scholar
  45. Palomba F, Bavota G, Di Penta M, Oliveto R, De Lucia A, Poshyvanyk D (2013) Detecting bad smells in source code using change history information. In Proceedings of the International Conference on Automated Software Engineering (ASE)Google Scholar
  46. Rachmawati L, Srinivasan D (2009) Multiobjective evolutionary algorithm with controllable focus on the knees of the Pareto front. IEEE Trans Evol Comput 13(4):810–824CrossRefGoogle Scholar
  47. Radu M (2004) Detection strategies: metrics-based rules for detecting design flaws. In Proc. 20th International Conference on Software Mainte- nance, pp 350–359Google Scholar
  48. Riel A (1996) Object-oriented design heuristics. Addison WesleyGoogle Scholar
  49. Sahraoui H, Godin R, Miceli T (2000) Can metrics help to bridge the gap between the improvement of OO design quality and its automation? In Proceedings of the International Conference on Software Maintenance (ICSM). IEEE Computer Society, pp 154–162Google Scholar
  50. 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 Genetic and Evolutionary Computation Conference (GECCO), pp 1909–1916Google Scholar
  51. Sunye G, Pollet D, T Yves Le, Jezequel J-M (2001) Refactoring UML models. In Proc. 4th International Conference on the Unified Modeling Language, volume LNCS 2185, pp 134–148Google Scholar
  52. Tom Mens T, Tourwe T (2004) A survey of software refactoring. IEEE Trans Softw Eng (TSE) 30(2):126–139CrossRefGoogle Scholar
  53. Trifu A, Reupke U (2007) Towards automated restructuring of object oriented systems. In Proc. 12th Working Conference on Reverse Engineering, pp 39–48Google Scholar
  54. Tsantalis N, Chatzigeorgiou A (2009) Identification of move method refactoring opportunities. IEEE Trans Softw Eng (TSE) 35(3):347–367CrossRefGoogle Scholar
  55. Van Emden E, Moonen L (2002) Java quality assurance by detecting code smells. In Proceedings of the Ninth Working Conference on Reverse Engineering (WCRE). IEEE Computer Society, Washington, pp 97–100Google Scholar
  56. Vargha A, Delaney HD (2000) A critique and improvement of the CL common language effect size statistics of McGraw and Wong. J Educ Behav Stat 25(2):101–132Google Scholar
  57. Yamashita A (2012) Assessing the capability of code smells to support software maintainability assessments: empirical inquiry and methodological approach. Doctoral Thesis, University of OsloGoogle Scholar
  58. Yamashita A, Moonen L (2012) Do code smells reflect important maintainability aspects? In: 28th IEEE International Conference on Software Maintenance (ICSM), pp 306–315Google Scholar
  59. Zamani B, Butler G (2009) Smell detection in UML designs which utilize pattern languages. Iran J Electr Comput Eng 8(1):47–52Google Scholar
  60. Zhang M, Hall T, Baddoo N (2011) Code bad smells: a review of current knowledge. J Softw Maint 23(3):179–202CrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media New York 2016

Authors and Affiliations

  • Mohamed Wiem Mkaouer
    • 1
  • Marouane Kessentini
    • 1
  • Mel Ó Cinnéide
    • 2
  • Shinpei Hayashi
    • 3
  • Kalyanmoy Deb
    • 4
  1. 1.University of MichiganDearbornUSA
  2. 2.University College DublinDublinIreland
  3. 3.Tokyo Institute of TechnologyTokyoJapan
  4. 4.Michigan State UniversityEast LansingUSA

Personalised recommendations