Exploring Transfer Learning for Multilingual Software Quality: Code Smells, Bugs, and Harmful Code

Authors

DOI:

https://doi.org/10.5753/jserd.2025.4593

Keywords:

code smells, software quality, machine learning, transfer learning

Abstract

Code smells are indicators of poor design implementation and decision-making that can potentially harm the quality of software. Therefore, detecting these smells is crucial to prevent such issues. Some studies aim to comprehend the impact of code smells on software quality, while others propose rules or machine learning-based approaches to identify code smells. Previous research has focused on labeling and analyzing code snippets that significantly impair software quality using machine learning techniques. These snippets are classified as Clean, Smelly, Buggy, and Harmful Code. Harmful Code refers to smelly code segments that have one or more reported bugs, whether fixed or not. Consequently, the presence of a Harmful Code increases the risk of introducing new defects and/or design issues during the remediation process. We perform our study as an extension of the previous study, with the scope of 5 smell types. The total number of commits across all four tables (Java, C++, C#, and Python projects) is 641,736, versions of 91 open-source projects, 17,022 bugs, and 24,737 code smells. The findings revealed promising transferability of knowledge between Java and C# in the presence of various code smell types, while C++ and Python exhibited more challenging transferability. Also, our study discovered that a sample size of 32 demonstrated favorable outcomes for most harmful codes, underscoring the efficiency of transfer learning even with limited data. Moreover, the exploration of transfer learning between bugs and code smells represents a not-very-ineffective avenue within the realm of software engineering.

Downloads

Download data is not yet available.

References

Amorim, L., Costa, et al. (2016). Experience report: Evaluating the effectiveness of decision trees for detecting code smells. ISSRE 2015.

Ardimento, P., Gravino, C., Scanniello, G., and Oliveto, R. (2021). Transfer learning for just-in-time design smells prediction using temporal convolutional networks. In Proceedings of the 16th International Conference on Software Technologies (ICSOFT), pages 25–36. SciTePress.

Barbosa, C., Uchoa, et al. (2020). Revealing the social aspects of design decay: A retrospective study of pull requests. In SBES, pages 364–373.

Barbosa, C., Uchoa, et al. (2023). Beyond the code: Investigating the effects of pull request conversations on design decay.

Falcão, F., Barbosa, et al. (2020). On relating technical, social factors, and the introduction of bugs. In 2020 (SANER). IEEE.

Fontana, F. A., Oivo, M., Palomba, F., Zanoni, M., and Janes, A. (2016). Comparing and experimenting machine learning techniques for code smell detection. In Proceedings of the 10th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM). ACM.

Fontana Arcelli, F. and Zanoni, M. (2017). Code smell severity classification using machine learning techniques. Knowledge-Based Systems.

Kalliamvakou, E., Gousios, et al. (2016). An in-depth study of the promises and perils of mining github. ESEM.

Kanal, L. N. (2003). Perceptron. In Encyclopedia of Computer Science, pages 1383–1385.

Kovacevic, A., Slivka, et al. (2022). Automatic detection of long method and god class code smells through neural source code embeddings. Expert Systems With Applications 204.

Krishna, R. and Menzies, T. (2019). Bellwethers: A baseline method for transfer learning. IEEE Transactions on Software Engineering, 45:1081–1105.

Lima, R., Souza, J., Teixeira, L., Fonseca, B., Ribeiro, M., Gheyi, R., de Mello, R., and Garcia, A. (2020). Understanding and detecting harmful code. In Proceedings of the 34th Brazilian Symposium on Software Engineering (SBES), pages 214–223. ACM.

Macia, I., Coelho, R., Garcia, A., Chavez, C., and Staa, A. V. (2012). On the relevance of code anomalies for identifying architecture degradation symptoms. In 2012 16th European Conference on Software Maintenance and Reengineering (CSMR), pages 277–286. IEEE.

Martin Fowler (1999). Refactoring: improving the design of existing code. Addison-Wesley.

Oizumi, W., Garcia, A., Colanzi, T., Ferreira, M., and Staa, A. (2014). When code-anomaly agglomerations represent architectural problems? An exploratory study. In SBES; Maceio, Brazil, pages 91–100.

Oizumi, W., Garcia, A., Colanzi, T., Staa, A., and Ferreira, M. (2015). On the relationship of code-anomaly agglomerations and architectural problems. JSERD.

Oizumi, W., Garcia, A., Sousa, L., Cafeo, B., and Zhao, Y. (2016). Code anomalies flock together: Exploring code anomaly agglomerations for locating design problems. In The 38th ICSE; USA.

Oizumi, W., Sousa, L., et al. (2019). On the density and diversity of degradation symptoms in refactored classes: A multi-case study. In IEEE 30th ISSRE.

Oizumi, W., Sousa, L., Oliveira, A., Garcia, A., Agbachi, O., Oliveira, R., and Lucena, C. (2018). On the identification of design problems in stinky code: experiences and tool support. J. Braz. Comp. Soc., 24(1):13:1–13:30.

Palomba, F., Bavota, et al. (2018). On the diffuseness and the impact on maintainability of code smells: a large scale empirical investigation. EMSE 2018.

Palomba, F., Zanoni, M., Arcelli Fontana, F., De Lucia, A., and Oliveto, R. (2019). Toward a smell-aware bug prediction model. IEEE Transactions on Software Engineering, 45(2):194–218.

Pereira Cesar, D., Barbosa Vieira da Silva, C., et al. (2023). Is your code harmful too? understanding harmful code through transfer learning. In SBQS, SBQS ’23.

Sharma, T., Efstathiou, V., Louridas, P., and Spinellis, D. (2019). On the feasibility of transfer-learning code smells using deep learning. ESEM, 1.

Sharma, T. and Spinellis, D. (2018). A survey on software smells. J. Syst. Softw. (JSS), 138:158–173.

Sousa, L., Oliveira, R., et al. (2017). How do software developers identify design problems?: A qualitative analysis. In SBES, SBES’17.

Stefano, M. D., Pecorelli, G., Fabio, A. D., Palomba, F., and Ferrucci, F. (2021). Comparing within- and cross-project machine learning algorithms for code smell detection. In Proceedings of the 3rd International Workshop on Machine Learning Techniques for Software Quality Evolution (MaLTESQuE). ACM.

Takahasi, A., Sae-Lim, N., Hayashi, S., and Saeki, M. (2018). A preliminary study on using code smells to improve bug localization. ICPC ’18.

Torrey, L. and Shavlik, J. (2010). Transfer learning. In Handbook of research on machine learning applications and trends: algorithms, methods, and techniques, pages 242–264. IGI global.

Śliwerski, J., Zimmermann, T., and Zeller, A. (2005). When do changes induce fixes? ACM SIGSOFT Software Engineering Notes, 30:1–5.

Downloads

Published

2025-04-08

How to Cite

Lima, R., Pereira, D., Barbosa, C., Leite, L., Baia, D., Fonseca, B., Teixeira, L., & Souza, J. (2025). Exploring Transfer Learning for Multilingual Software Quality: Code Smells, Bugs, and Harmful Code. Journal of Software Engineering Research and Development, 13(1), 13:207 – 13:217. https://doi.org/10.5753/jserd.2025.4593

Issue

Section

Research Article

Most read articles by the same author(s)