An Approach to Suggest Code Smell Order for Refactoring

  • Thirupathi GuggulothuEmail author
  • Salman Abdul MoizEmail author
Conference paper
Part of the Communications in Computer and Information Science book series (CCIS, volume 985)


Code smell is an indicator of issues in source code qualities that may hinder maintenance, and evolution. Source code metrics are used to measure the quality of the code. In the literature, there are many code smells, refactoring techniques, and refactoring tools. However, a software project often contains thousands of code smells and many of them have no relation with design quality. It is a challenge for developers to decide which kind of code smell should be refactored first. We have proposed an approach that suggests a code smell order based on two aspects: (1) finding relevant metrics for each code smell dataset with the help of feature selection technique (2) analyzing the internal relation among the code smells with those relevant metrics. With this analysis, we are suggesting code smell order for developers to save their effort in the refactoring stage. The suggested order is evaluated on simple java source code.


Code smell Refactoring Maintenance Design quality Code smell order Feature selection technique 


  1. 1.
    Martin, F., Beck, K., Brant, J., Opdyke, W., Roberts, D.: Refactoring: improving the design of existing programs (1999)Google Scholar
  2. 2.
    Opdyke, W.F.: Refactoring: a program restructuring aid in designing object-oriented application frameworks. Ph.D. dissertation, Ph.D. thesis, University of Illinois at Urbana-Champaign (1992)Google Scholar
  3. 3.
    Rasool, G., Arshad, Z.: A review of code smell mining techniques. J. Softw.: Evol. Process 27(11), 867–895 (2015)Google Scholar
  4. 4.
    Liu, H., Ma, Z., Shao, W., Niu, Z.: Schedule of bad smell detection and resolution: a new way to save effort. IEEE Trans. Softw. Eng. 38(1), 220–235 (2012)CrossRefGoogle Scholar
  5. 5.
    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)CrossRefGoogle Scholar
  6. 6.
    Vidal, S.A., Marcos, C., Díaz-Pace, J.A.: An approach to prioritize code smells for refactoring. Autom. Softw. Eng. 23(3), 501–532 (2016)CrossRefGoogle Scholar
  7. 7.
    Fontana, F.A., Mäntylä, M.V., Zanoni, M., Marino, A.: Comparing and experimenting machine learning techniques for code smell detection. Empirical Softw. Eng. 21(3), 1143–1191 (2016)CrossRefGoogle Scholar
  8. 8.
    Booch, G.: Object-oriented Analysis and Design. Addison-Wesley, Boston (1980)zbMATHGoogle Scholar
  9. 9.
    Demeyer, S., Ducasse, S., Nierstrasz, O.: Object-Oriented Reengineering Patterns. Elsevier (2002)Google Scholar
  10. 10.
    Pietrzak, B., Walter, B.: Leveraging code smell detection with inter-smell relations. In: Abrahamsson, P., Marchesi, M., Succi, G. (eds.) XP 2006. LNCS, vol. 4044, pp. 75–84. Springer, Heidelberg (2006). Scholar
  11. 11.
    Quinlan, J.: Induction of decision trees. Mach. Learn. 1(1), 81–106 (1986)Google Scholar
  12. 12.
    Fontana, F.A., Ferme, V., Zanoni, M.: Towards assessing software architecture quality by exploiting code smell relations. In: Proceedings of the Second International Workshop on Software Architecture and Metrics, pp. 1–7. IEEE Press (2015)Google Scholar

Copyright information

© Springer Nature Singapore Pte Ltd. 2019

Authors and Affiliations

  1. 1.University of HyderabadHyderabadIndia

Personalised recommendations