Skip to main content
Log in

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

  • Published:
Empirical Software Engineering Aims and scope Submit manuscript

Abstract

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.

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

Similar content being viewed by others

References

  • Anda B (2007) Assessing software system maintainability using structural measures and expert assessments. In: International Conference on Software Maintenance (ICSM), pp 204–213

  • 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–183

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

  • Bansiya J, Davis CG (2002) A hierarchical model for object-oriented design quality assessment. IEEE Trans Softw Eng 28(1):4–17

    Article  Google Scholar 

  • Beyer H-G (2004) Actuator noise in recombinant evolution strategies on general quadratic fitness models. In Genetic and Evolutionary Computation Conference (GECCO), pp 654–665

  • Beyer H-G, Sendhoff B (2007) Robust optimization – A comprehensive survey. Comput Methods Appl Mech Eng 196(33–34):3190–3218

    Article  MathSciNet  MATH  Google Scholar 

  • Brown W-J, Malveau R-C, Brown W-H, Mowbray TJ (1998) Anti Patterns: refactoring Software, Architectures, and Projects in Crisis, 1st edn. Wiley

  • Brown W-J, Malveau R, McCormick H-W, Mowbray TJ (1998b) Antipatterns: refactoring software, architectures, and projects in crisis. Wiley, New York

    Google Scholar 

  • Brown WJ, Malveau RC, McCormick HW, Mowbray TJ (1998) AntiPatterns: refactoring Software, Architectures, and Projects in Crisis. Wiley

  • Chatzigeorgiou A, Manakos A (2013) Investigating the evolution of code smells in object-oriented systems, innovations in systems and software engineering. NASA J

  • Coad P, Yourdon E (1991) Object-oriented design. Yourdon Press, Upper Saddle River

    Google Scholar 

  • Coelho W, Murphy G (2007) ClassCompass: a software design men- toring system. Educ Resour Comput 7:1–18

    Google Scholar 

  • 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–31

  • Das I (2000) Robustness optimization for constrained nonlinear programming problem. Eng Optim 32(5):585–618

    Article  Google Scholar 

  • Deb K, Gupta S (2011) Understanding knee points in bi-criteria problems and their implications as preferred solution principles. Eng Optim 43(11):1175–1204

    Article  MathSciNet  Google Scholar 

  • 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–197

    Article  Google Scholar 

  • 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–151

  • 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)

  • 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–1039

  • Fontana FA, Mäntylä MV, Zanoni M, Marino A (2015) Comparing and experimenting machine learning techniques for code smell detection. Empir Softw Eng:1–49

  • Fowler M, Beck K, Brant J, Opdyke W, Roberts D (1999) Refactoring – Improving the design of existing code, 1st edn Addison-Wesley

  • Glass RL (2001) Frequently forgotten fundamental facts about software engineering. Softw Trends IEEE 18(3):112–111. doi:10.1109/MS.2001.922739

    Article  Google Scholar 

  • 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–1680

  • 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 33

    Article  Google Scholar 

  • 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–1113

  • Harman M, Mansouri A, Zhang Y (2012) Search-based software engineering: trends, techniques and applications. ACM Comput Surv

  • 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–1348

  • Jin Y, Branke J (2005) Evolutionary optimization in uncertain environments – A survey. IEEE Trans Evol Comput 9(3):303–317

    Article  Google Scholar 

  • 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–251

  • 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–743

  • Kerievsky J (2004) Refactoring to patterns. Addison Wesley

  • 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–90

  • Li X (2003) A non-dominated sorting particle swarm optimizer for multiobjective optimization. In: The Genetic and Evolutionary Computation Conference (GECCO), pp 37–48

  • Mäntylä M-V, Lassenius C (2006) Subjective evaluation of software evolvability using code smells: an empirical study. Empir Softw Eng:395–431

  • Marinescu R (2010) inCode: continuous quality assessment and improvement. In Proceedings of the 14th Conference on Software Maintenance and Reengineering (CSMR)

  • 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–183

  • Moghadam IH, Ó Cinnéide M (2012) Automated refactoring using design differencing. In Proceedings of European Conference on Software Maintenance and Reengineering (ECSM’12)

  • 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–36

    Article  MATH  Google Scholar 

  • Ó 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–58

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

  • 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). IEEE

  • 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–251

  • Opdyke WF (1992) Refactoring object-oriented frameworks. Ph.D. Dissertation. University of Illinois at Urbana-Champaign, Champaign. UMI Order No. GAX93-05645

  • Ouni A, Kessentini M, Sahraoui H, Boukadoum M (2012) Maintainability defects detection and correction: a multi-objective approach. J Autom Softw Eng:47–79

  • 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)

  • 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–824

    Article  Google Scholar 

  • Radu M (2004) Detection strategies: metrics-based rules for detecting design flaws. In Proc. 20th International Conference on Software Mainte- nance, pp 350–359

  • Riel A (1996) Object-oriented design heuristics. Addison Wesley

  • 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–162

  • 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–1916

  • 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–148

  • Tom Mens T, Tourwe T (2004) A survey of software refactoring. IEEE Trans Softw Eng (TSE) 30(2):126–139

    Article  Google Scholar 

  • Trifu A, Reupke U (2007) Towards automated restructuring of object oriented systems. In Proc. 12th Working Conference on Reverse Engineering, pp 39–48

  • Tsantalis N, Chatzigeorgiou A (2009) Identification of move method refactoring opportunities. IEEE Trans Softw Eng (TSE) 35(3):347–367

    Article  Google Scholar 

  • 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–100

  • 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–132

    Google Scholar 

  • Yamashita A (2012) Assessing the capability of code smells to support software maintainability assessments: empirical inquiry and methodological approach. Doctoral Thesis, University of Oslo

  • Yamashita A, Moonen L (2012) Do code smells reflect important maintainability aspects? In: 28th IEEE International Conference on Software Maintenance (ICSM), pp 306–315

  • Zamani B, Butler G (2009) Smell detection in UML designs which utilize pattern languages. Iran J Electr Comput Eng 8(1):47–52

    Google Scholar 

  • Zhang M, Hall T, Baddoo N (2011) Code bad smells: a review of current knowledge. J Softw Maint 23(3):179–202

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Marouane Kessentini.

Additional information

Communicated by: Claire Le Goues and Shin Yoo

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Mkaouer, M.W., Kessentini, M., Cinnéide, M.Ó. et al. A robust multi-objective approach to balance severity and importance of refactoring opportunities. Empir Software Eng 22, 894–927 (2017). https://doi.org/10.1007/s10664-016-9426-8

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10664-016-9426-8

Keywords

Navigation