AUTOMATIC DETECTION OF CODE SMELLS BASED ON CODE CHANGE HISTORY

Authors

  • Simona Prokić Autor

DOI:

https://doi.org/10.24867/11BE03Prokic

Keywords:

machine learning, transformer, code smells

Abstract

This paper presents a machine learning model for automatic detection of code smells based on code change history. The model's inputs are the source code metrics' values in n revisions for the observed code snippet. The model's output is a label that indicates whether the observed code snippet contains a code smell or not. We test the model on the case study of detecting classes with many responsibilities (God Classes). Steps for further architecture improvement are discussed.

References

[1] Martin, R.C., 2002. Agile software development: principles, patterns, and practices. Prentice Hall.
[2] Fowler, M., 2018. Refactoring: improving the design of existing code. Addison-Wesley Professional.
[3] Fernandes, E., Oliveira, J., Vale, G., Paiva, T., and Figueiredo, E., 2016, June. A review-based comparative study of bad smell detection tools. In Proceedings of the 20th International Conference on Evaluation and Assessment in Software Engineering (p. 18.). ACM.
[4] Azeem, M.I., Palomba, F., Shi, L. and Wang, Q., 2019. Machine learning techniques for code smell detection: A systematic literature review and meta-analysis. Information and Software Technology.
[5] Lui, Y., Li, Y., Guo, J., Zhou, Y., Xu, B., 2018. Connecting Software Metrics across Versions to Predict Defects. In 2018 IEEE 25th International Conference on Software Analysis, Evolution and Reengineering (SANER) (pp. 232-243). IEEE.
[6] Wen, M., Wu, R. and Cheung, S.C., 2018. How well do change sequences predict defects? Sequence learning from software changes. IEEE Transactions on Software Engineering.
[7] Barbez, A., Khomh, F. and Guéhéneuc, Y.G., 2019. Deep Learning Anti-patterns from Code Metrics History. IEEE International Conference on Software Maintenance and Evolution (ICSME) pp. 114-124.
[8] Palomba, F., Bavota, G., Di Penta, M., Fasano, F., Oliveto, R. and De Lucia, A., 2018. On the diffuseness and the impact on maintainability of code smells: a large scale empirical investigation. Empirical Software Engineering, 23(3), pp.1188-1221.
[9] Pantiuchina, J., Bavota, G., Tufano, M. and Poshyvanyk, D., 2018. Towards Just-In-Time Refactoring Recommenders. ACM/IEEE 26th International Conference on Program Comprehension.
[10] Chawla, N. V., Bowyer, K. W., Hall, L. O., Kegelmeyer, W. P., 2002. SMOTE: Synthetic Minority Over-sampling Technique. Journal of Artificial Intelligence Research 16 (2002): 321–357.
[11] Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A., Kaiser, L., Polosukhin, I., 2017. Attention Is All You Need.

Published

2020-12-23

Issue

Section

Electrotechnical and Computer Engineering