Investigando o Impacto das Coocorrências de Code Smells nos Atributos Internos de Qualidade

  • Júlio Serafim Martins UFC
  • Carla I. M. Bezerra UFC

Resumo


O objetivo deste trabalho foi investigar o impacto de coocorrências de code smells para os atributos internos de qualidade, como coesão, acoplamento, complexidade, herança e tamanho e também para os desenvolvedores. Foram executados dois estudos em projetos industriais, e os principais resultados e contribuições desse trabalho, são: (i) as coocorrências Feature Envy–God Class, Dispersed Coupling–God Class e God Class-Long Method são extremamente prejudiciais para a qualidade de software e para os desenvolvedores; (ii) o número de coocorrências de code smells tende a aumentar durante o desenvolvimento do sistema; (iii) desenvolvedores têm mais dificuldade para entender códigos contendo coocorrências de smells; e, (iv) desenvolvedores ainda possuem inseguranças em relação a identificação e refatoração de code smells e suas coocorrências. A partir dos resultados deste trabalho, foi possível gerar um catálogo prático sobre a remoção das coocorrências de code smells mais prejudicais para os atributos interno de qualidade e também sob a perspectiva dos desenvolvedores.

Palavras-chave: Co-ocorrências de code smells, Refatoração, Atributos internos de qualidade

Referências

Abbes, M., Khomh, F., Gueheneuc, Y.-G., and Antoniol, G. (2011). An empirical study of the impact of two antipatterns, blob and spaghetti code, on program comprehension. In 15th CSMR, pages 181-190. IEEE.

Abid, C., Alizadeh, V., Kessentini, M., Ferreira, T. d. N., and Dig, D. (2020). 30 years of software refactoring research: A systematic literature review. arXiv preprint arXiv:2007.02194.

Alenezi, M. and Almustafa, K. (2015). Empirical analysis of the complexity evolution in open-source software systems. International Journal of Hybrid Information Technology, 8(2):257-266.

AlOmar, E. A., Mkaouer, M. W., Ouni, A., and Kessentini, M. (2019). On the impact of refactoring on the relationship between quality attributes and design metrics. In 2019 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM), pages 1-11. IEEE.

Chávez, A., Ferreira, I., Fernandes, E., Cedrim, D., and Garcia, A. (2017). How does refactoring affect internal quality attributes?: A multi-project study. In 31st SBES, pages 74-83. ACM.

Chidamber, S. R. and Kemerer, C. F. (1994). A metrics suite for object oriented design. IEEE Trans. Softw. Eng., 20(6):476-493.

Darcy, D. P., Kemerer, C. F., Slaughter, S. A., and Tomayko, J. E. (2005). The structural complexity of software an experimental test. IEEE Trans. Softw. Eng., 31(11):982-995.

de Sobrinho Paulo, E. V., De Lucia, A., and de Almeida Maia, M. (2018). A systematic literature review on bad smells-5 w's: which, when, what, who, where. IEEE Trans. Softw. Eng.

Destefanis, G., Counsell, S., Concas, G., and Tonelli, R. (2014). Software metrics in agile software: An empirical study. In International Conference on Agile Software Development, pages 157-170. Springer.

Fernandes, E., Chávez, A., Garcia, A., Ferreira, I., Cedrim, D., Sousa, L., and Oizumi, W. (2020). Refactoring effect on internal quality attributes: What haven't they told you yet? Inf. Softw. Technol., page 106347.

Fernandes, E., Vale, G., Sousa, L., Figueiredo, E., Garcia, A., and Lee, J. (2017). No code anomaly is an island. In 16th ICSR, pages 48-64. Springer.

Fontana, F. A., Ferme, V., and Zanoni, M. (2015). Towards assessing software architecture quality by exploiting code smell relations. In 2015 IEEE/ACM 2nd International Workshop on Software Architecture and Metrics, pages 1-7. IEEE.

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

Kaur, A. (2019). A systematic literature review on empirical analysis of the relationship between code smells and software quality attributes. Archives of Computational Methods in Engineering, pages 1-30.

Kaur, A. and Dhiman, G. (2019). A review on search-based tools and techniques to identify bad code smells in object-oriented systems. In Harmony search and nature inspired optimization algorithms, pages 909-921. Springer.

Kaur, S. and Singh, P. (2019). How does object-oriented code refactoring influence software quality? research landscape and challenges. Journal of Systems and Software, 157:110394.

Kaur, S. and Singh, S. (2016). Spotting & eliminating type checking code smells using eclipse plug-in: Jdeodorant. International Journal of Computer Science and Communication Engineering, 5(1).

Kokol, P., Kokol, M., and Zagoranski, S. (2021). Code smells: A synthetic narrative review. arXiv preprint arXiv:2103.01088.

Lacerda, G., Petrillo, F., Pimenta, M., and Guéhéneuc, Y. G. (2020). Code smells and refactoring: a tertiary systematic review of challenges and observations. J. Syst. Softw., page 110610.

Lanza, M. and Marinescu, R. (2007). Object-oriented metrics in practice: using software metrics to characterize, evaluate, and improve the design of object-oriented systems. Springer Science & Business Media.

Lorenz, M. and Kidd, J. (1994). Object-oriented software metrics: a practical guide. Prentice-Hall, Inc.

Lozano, A., Mens, K., and Portugal, J. (2015). Analyzing code evolution to uncover relations. In 2nd PPAP, pages 1-4. IEEE.

Martin, R. C. (2000). Design principles and design patterns. Object Mentor, 1(34):597.

Martins, J., Bezerra, C., Uchó‚a, A., and Garcia, A. (2020). Are code smell co-occurrences harmful to internal quality attributes? a mixed-method study. In Proceedings of the 34th Brazilian Symposium on Software Engineering, pages 52-61.

Martins, J., Bezerra, C. I. M., and Uchó‚a, A. (2019). Analyzing the impact of inter-smell relations on software maintainability: An empirical study with software product lines. In Proceedings of the XV Brazilian Symposium on Information Systems, pages 1-8.

McCabe, T. J. (1976). A complexity measure. IEEE Trans. Softw. Eng., (4):308-320.

Morasca, S. (2009). A probability-based approach for measuring external attributes of software artifacts. In 3rd ESEM, pages 44-55. IEEE Computer Society.

Neamtiu, I., Xie, G., and Chen, J. (2013). Towards a better understanding of software evolution: an empirical study on open-source software. J. Softw.: Evol. Process, 25(3):193-218.

Oizumi, W., Garcia, A., da Silva Sousa, L., Cafeo, B., and Zhao, Y. (2016). Code anomalies flock together: Exploring code anomaly agglomerations for locating design problems. In 38th ICSE, pages 440-451. IEEE.

Palomba, F., Bavota, G., Di Penta, M., Fasano, F., Oliveto, R., and De Lucia, A. (2018). A large-scale empirical study on the lifecycle of code smell co-occurrences. Inf. Softw. Technol., 99:1-10.

Palomba, F., Bavota, G., Di Penta, M., Oliveto, R., and De Lucia, A. (2014). Do they really smell bad? a study on developers' perception of bad code smells. In 2014 IEEE International Conference on Software Maintenance and Evolution, pages 101-110.

Pate, J. R., Tairas, R., and Kraft, N. A. (2013). Clone evolution: a systematic review. Journal of software: Evolution and Process, 25(3):261-283.

Pietrzak, B. and Walter, B. (2006). Leveraging code smell detection with inter-smell relations. Extreme Programming and Agile Processes in Software Engineering, pages 75-84.

Politowski, C., Khomh, F., Romano, S., Scanniello, G., Petrillo, F., Guéhéneuc, Y.-G., and Maiga, A. (2020). A large scale empirical study of the impact of spaghetti code and blob anti-patterns on program comprehension. Information and Software Technology, 122:106278.

Santana, A., Cruz, D., and Figueiredo, E. (2021). An exploratory study on the identification and evaluation of bad smell agglomerations. In Proceedings of the 36th Annual ACM Symposium on Applied Computing, pages 1289-1297.

Santos, J. A. M., Rocha-Junior, J. B., Prates, L. C. L., do Nascimento, R. S., Freitas, M. F., and de Mendonça, M. G. (2018). A systematic review on the code smell effect. J. Syst. Softw., 144:450-477.

Singjai, A., Simhandl, G., and Zdun, U. (2021). On the practitioners' understanding of coupling smells-a grey literature based grounded-theory study. Information and Software Technology, 134:106539.

Subramanyam, R. and Krishnan, M. S. (2003). Empirical analysis of ck metrics for object-oriented design complexity: Implications for software defects. IEEE Trans. Softw. Eng., 29(4):297-310.

Tahir, A., Yamashita, A., Licorish, S., Dietrich, J., and Counsell, S. (2018). Can you tell me if it smells? a study on how developers discuss code smells and anti-patterns in stack overflow. In Proceedings of the 22nd International Conference on Evaluation and Assessment in Software Engineering 2018, pages 68-78.

Taibi, D., Janes, A., and Lenarduzzi, V. (2017). How developers perceive smells in source code: A replicated study. Information and Software Technology, 92:223-235.

Taube-Schock, C., Walker, R. J., and Witten, I. H. (2011). Can we avoid high coupling? In European Conference on Object-Oriented Programming, pages 204-228. Springer.

Vidal, S., Vazquez, H., Diaz-Pace, J. A., Marcos, C., Garcia, A., and Oizumi, W. (2015). Jspirit: a flexible tool for the analysis of code smells. In 34th SCCC, pages 1-6. IEEE.

Walter, B., Fontana, F. A., and Ferme, V. (2018). Code smells and their collocations: A large-scale experiment on open-source systems. J. Syst. Softw., 144:1-21.

Yamashita, A. and Moonen, L. (2013a). Do developers care about code smells? an exploratory survey. In 20th WCRE, pages 242-251. IEEE.

Yamashita, A. and Moonen, L. (2013b). Exploring the impact of inter-smell relations on software maintainability: An empirical study. In 35th ICSE, pages 682-691. IEEE.

Yamashita, A., Zanoni, M., Fontana, F. A., and Walter, B. (2015). Inter-smell relations in industrial and open source systems: A replication and comparative analysis. In 31st ICSME, pages 121-130. IEEE.
Publicado
03/10/2022
MARTINS, Júlio Serafim; BEZERRA, Carla I. M.. Investigando o Impacto das Coocorrências de Code Smells nos Atributos Internos de Qualidade. In: CONCURSO DE TESES E DISSERTAÇÕES EM ENGENHARIA DE SOFTWARE (CTD-ES) - CONGRESSO BRASILEIRO DE SOFTWARE: TEORIA E PRÁTICA (CBSOFT), 13. , 2022, Uberlândia/MG. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2022 . p. 50-64. DOI: https://doi.org/10.5753/cbsoft_estendido.2022.225602.