Advertisement

Automated Software Engineering

, Volume 23, Issue 3, pp 501–532 | Cite as

An approach to prioritize code smells for refactoring

  • Santiago A. Vidal
  • Claudia Marcos
  • J. Andrés Díaz-Pace
Article

Abstract

Code smells are a popular mechanism to find structural design problems in software systems. Consequently, several tools have emerged to support the detection of code smells. However, the number of smells returned by current tools usually exceeds the amount of problems that the developer can deal with, particularly when the effort available for performing refactorings is limited. Moreover, not all the code smells are equally relevant to the goals of the system or its health. This article presents a semi-automated approach that helps developers focus on the most critical problems of the system. We have developed a tool that suggests a ranking of code smells, based on a combination of three criteria, namely: past component modifications, important modifiability scenarios for the system, and relevance of the kind of smell. These criteria are complementary and enable our approach to assess the smells from different perspectives. Our approach has been evaluated in two case-studies, and the results show that the suggested code smells are useful to developers.

Keywords

Code smells Refactoring Software evolution Design problems 

Notes

Acknowledgments

This work was partially supported by CONICET (Argentina) through PIP Project No. 112-201101-00078. We are grateful to Mauricio Arroqui and Carlos Machado for their valuable collaboration in the BCFS case-study.

References

  1. April, A., Abran, A.: Software maintenance management: evaluation and continuous improvement. IEEE Computer Society (2008)Google Scholar
  2. Arcoverde, R.L.: Prioritization of code anomalies basead on architecture sensitiveness. Master’s thesis, Pontifícia Universidade Católica do Rio de Janeiro (2012)Google Scholar
  3. Bashroush, R., Spence, I.T.A., Kilpatrick, P., Brown, T.J.: Towards an automated evaluation process for software architectures. In: IASTED Conference on Software Engineering, pp. 54–58 (2004)Google Scholar
  4. Clements, P., Kazman, R.: Software Architecture in Practice. Addison-Wesley Longman Publishing Co., Inc., Boston (2003)Google Scholar
  5. D’Ambros, M., Lanza, M.: Visual software evolution reconstruction. J. Softw. Maint. 21(3), 217–232 (2009)CrossRefGoogle Scholar
  6. Demeyer, S., Ducasse, S., Nierstrasz, O.: Object-Oriented Reengineering Patterns. Morgan Kaufmann, San Francisco (2003)zbMATHGoogle Scholar
  7. Erlikh, L.: Leveraging legacy system dollars for e-business. IT Prof. 2(3), 17–23 (2000). doi: 10.1109/6294.846201 CrossRefGoogle Scholar
  8. Fowler, M.: Refactoring: Improving the Design of Existing Code. Addison-Wesley Longman Publishing Co., Inc., Boston (1999)zbMATHGoogle Scholar
  9. Gamma, E., Helm, R., Johnson, R.E.: Design Patterns. Elements of Reusable Object-Oriented Software, 1st edn. Addison-Wesley Longman, Amsterdam (1995)Google Scholar
  10. Gîrba, T., Ducasse, S., Lanza, M.: Yesterday’s weather: guiding early reverse engineering efforts by summarizing the evolution of changes. In: ICSM, IEEE Computer Society, pp 40–49 (2004)Google Scholar
  11. Hurtado, J.F., Sabadini, F., Vidal, S., Marcos, C.: Predicción del cambio a través de la historia del sistema. In: 14th Argentine Symposium on Software Engineering (ASSE 2013), 42 JAIIO (Jornadas Argentinas de Informática) (2013). In SpanishGoogle Scholar
  12. Kazman, R., Abowd, G.D., Bass, L.J., Clements, P.C.: Scenario-based analysis of software architecture. IEEE Softw. 13(6), 47–55 (1996)CrossRefGoogle Scholar
  13. Kim, M., Zimmermann, T., Nagappan, N.: A field study of refactoring challenges and benefits. In: Proceedings of 20th International Symposium on the Foundations of Software Engineering (FSE) (2012)Google Scholar
  14. Lanza, M., Marinescu, R.: Object-Oriented Metrics in Practice: Using Software Metrics to Characterize, Evaluate, and Improve the Design of Object-Oriented Systems. Springer, New York (2006)zbMATHGoogle Scholar
  15. Levy, H.: Fundamentals of investments. Financial Times, Prentice Hall (2002)Google Scholar
  16. Macia, I., Arcoverde, R., Cirilo, E., Garcia, A., von Staa, A.: Supporting the identification of architecturally-relevant code anomalies. In: 28th IEEE International Conference on Software Maintenance (ICSM), pp. 662–665 (2012a). doi: 10.1109/ICSM.2012.6405348
  17. Macia, I., Arcoverde, R., Garcia, A., Chavez, C., von Staa, A.: On the relevance of code anomalies for identifying architecture degradation symptoms. In: CSMR (2012b)Google Scholar
  18. Mangudo, P., Arroqui, M., Marcos, C., Machado, C.: Rescue of a whole-farm system: crystal clear in action. Int. J. Agile Extrem. Softw. Dev. 1, 6–22 (2012)CrossRefGoogle Scholar
  19. Marcos, C., Vidal, S., Abait, E., Arroqui, M., Sampaoli, S.: Refactoring of a beef-cattle farm simulator. IEEE Lat. Am. Trans. 9, 1099–1104 (2011)CrossRefGoogle Scholar
  20. Marinescu, R.: Assessing technical debt by identifying design flaws in software systems. IBM J. Res. Dev. 56(5), 9 (2012)CrossRefGoogle Scholar
  21. Mens, T., Demeyer, S.: Future trends in software evolution metrics. In: Proceedings of the 4th International Workshop on Principles of Software Evolution, ACM, New York, IWPSE ’01, pp. 83–86 (2001). doi: 10.1145/602461.602476
  22. Mkaouer, M.W., Kessentini, M., Bechikh, S., Ó Cinnéide, M.: A robust multi-objective approach for software refactoring under uncertainty. In: Le Goues, C., Yoo, S. (eds.) Search-Based Software Engineering, Lecture Notes in Computer Science, vol. 8636, pp. 168–183. Springer International Publishing, New York (2014)Google Scholar
  23. Moha, N., Guéhéneuc, Y.G., Duchien, L., Meur, A.F.L.: Decor: a method for the specification and detection of code and design smells. IEEE Trans. Softw. Eng. 36(1), 20–36 (2010)CrossRefzbMATHGoogle Scholar
  24. Ozkaya, I., Díaz Pace, J.A., Gurfinkel, A., Chaki, S.: Using architecturally significant requirements for guiding system evolution. In: CSMR, IEEE, pp. 127–136 (2010)Google Scholar
  25. Ricci, F., Rokach, L., Shapira, B., Kantor, P.B. (eds.): Recommender Systems Handbook. Springer, New York (2011). http://dblp.uni-trier.de/db/reference/rsh/rsh2011.html
  26. Seacord, R., Plakosh, D., Lewis, G.: Modernizing Legacy Systems: Software Technologies, Engineering Processes, and Business Practices. Addison-Wesley Professional, Boston (2003)Google Scholar
  27. Tsantalis, N., Chatzigeorgiou, : Identification of refactoring opportunities introducing polymorphism. J. Syst. Softw. 83(3), 391–404 (2010)CrossRefGoogle Scholar
  28. Tsantalis, N., Chatzigeorgiou, A.: Identification of extract method refactoring opportunities for the decomposition of methods. J. Syst. Softw. 84(10), 1757–1782 (2011a)CrossRefGoogle Scholar
  29. Tsantalis, N., Chatzigeorgiou, A.: Ranking refactoring suggestions based on historical volatility. In: Kanellopoulos, Y., Winter, A., Mens, T. (eds.) CSMR, pp. 25–34. IEEE Computer Society, Los Alamitos (2011b)Google Scholar
  30. Vidal, S.A.: (2013) Spirit: Smart identification of refactoring opportunities. Ph.D. thesis, UNICEN UniversityGoogle Scholar
  31. Wong, S., Cai, Y., Kim, M., Dalton, M.: Detecting software modularity violations. In: Taylor, R.N., Gall, H., Medvidovic, N. (eds.) ICSE, pp. 411–420. ACM (2011)Google Scholar
  32. Woods, E.: Industrial architectural assessment using tara. J. Syst. Softw. 85(9), 2034–2047 (2012)CrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media New York 2014

Authors and Affiliations

  • Santiago A. Vidal
    • 1
    • 2
  • Claudia Marcos
    • 1
    • 3
  • J. Andrés Díaz-Pace
    • 1
    • 2
  1. 1.ISISTANUNICENTandilArgentina
  2. 2.CONICETTandilArgentina
  3. 3.CICBuenos AiresArgentina

Personalised recommendations