Refactoring Recommendations with Machine Learning

Resumo


A refatoração é uma atividade bem conhecida na engenharia de software que visa alterar um trecho de código-fonte para melhorar os atributos de qualidade estrutural sem alterar o comportamento externo. Sabe-se que a refatoração manual é uma prática comum, mas é uma atividade demorada e sujeita a erros. Na literatura é possível encontrar abordagens cujo objetivo é recomendar automaticamente refatorações para engenheiros de software. O objetivo é principalmente melhorar a produtividade e a qualidade interna dos sistemas. No entanto, observamos que as abordagens de recomendações de refatoração ainda são imaturas, mesmo aquelas baseadas em Machine Learning (ML). Assim, este doutorado visa pesquisar como ML, juntamente com modelos de explicabilidade, podem ser usados para melhorar as recomendações de refatoração.

Palavras-chave: recomendação de refatorações, refatoração, aprendizado de máquina, explicável IA

Referências

Alizadeh, V., Fehri, H., and Kessentini, M. (2019). Less is more: From multi-objective to mono-objective refactoring via developer’s knowledge extraction. In 2019 19th International Working Conference on Source Code Analysis and Manipulation (SCAM), pages 181–192. IEEE.

Angelov, P. P., Soares, E. A., Jiang, R., Arnold, N. I., and Atkinson, P. M. (2021). Explainable artificial intelligence: an analytical review. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 11(5):e1424.

Celebi, M. E. and Aydin, K. (2016). Unsupervised learning algorithms. Springer.

Fokaefs, M., Tsantalis, N., and Chatzigeorgiou, A. (2007). Jdeodorant: Identification and removal of feature envy bad smells. In 2007 ieee international conference on software maintenance, pages 519–520. IEEE.

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

Gunning, D. (2017). Explainable artificial intelligence (xai). Defense advanced research projects agency (DARPA), nd Web, 2(2):1.

Henrique, J., Dosea, M., and Sant’Anna, C. (2021). "Minerando Motivações para Aplicação de Extract Method: Um Estudo Preliminar." Anais do IX Workshop de Visualização, Evolução e Manutenção de Software, pages 21–25. SBC.

Imazato, A., Higo, Y., Hotta, K., and Kusumoto, S. (2017). Finding extract method refactoring opportunities by analyzing development history. In 2017 IEEE 41st Annual Computer Software and Applications Conference (COMPSAC), volume 1, pages 190–195. IEEE.

Kumar, L., Satapathy, S. M., and Krishna, A. (2018). Application of smote and lssvm with various kernels for predicting refactoring at method level. In International Conference on Neural Information Processing, pages 150–161. Springer.

Kurbatova, Z., Veselov, I., Golubev, Y., and Bryksin, T. (2020). Recommendation of move method refactoring using path-based representation of code. In Proceedings of the IEEE/ACM 42nd International Conference on Software Engineering Workshops, pages 315–322.

Michalski, R., Carbonell, J., and Mitchell, T. (1985). Machine learning: Artificial intelligence approach.

Nyamawe, A. S., Liu, H., Niu, N., Umer, Q., and Niu, Z. (2020). Feature requests-based recommendation of software refactorings. Empirical Software Engineering, 25(5):4315–4347.

Pantiuchina, J., Lin, B., Zampetti, F., Di Penta, M., Lanza, M., and Bavota, G. (2021). Why do developers reject refactorings in open-source projects? ACM Transactions on Software Engineering and Methodology (TOSEM), 31(2):1–23.

Sheneamer, A. M. (2020). An automatic advisor for refactoring software clones based on machine learning. IEEE Access, 8:124978–124988.

Silva, D., Silva, J., Santos, G. J. D. S., Terra, R., and Valente, M. T. O. (2020). Refdiff 2.0: A multi-language refactoring detection tool. IEEE Transactions on Software Engineering.

Terra, R., Valente, M. T., Miranda, S., and Sales, V. (2018). Jmove: A novel heuristic and tool to detect move method refactoring opportunities. Journal of Systems and Software, 138:19–36.

Tsantalis, N., Ketkar, A., and Dig, D. (2022). Refactoringminer 2.0. IEEE Transactions on Software Engineering, 48(3):930–950.

Xu, S., Guo, C., Liu, L., and Xu, J. (2017). A log-linear probabilistic model for prioritizing extract method refactorings. In 2017 3rd IEEE International Conference on Computer and Communications (ICCC), pages 2503–2507. IEEE.

Yue, R., Gao, Z., Meng, N., Xiong, Y., Wang, X., and Morgenthaler, J. D. (2018). Automatic clone recommendation for refactoring based on the present and the past. In 2018 IEEE International Conference on Software Maintenance and Evolution (ICSME), pages 115–126. IEEE.
Publicado
07/11/2022
Como Citar

Selecione um Formato
ARMIJO, Guisella A.; CAMARGO, Valter V. de. Refactoring Recommendations with Machine Learning. In: WORKSHOP DE TESES E DISSERTAÇÕES EM QUALIDADE DE SOFTWARE - SIMPÓSIO BRASILEIRO DE QUALIDADE DE SOFTWARE (SBQS), 21. , 2022, Curitiba/PR. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2022 . p. 15-22. DOI: https://doi.org/10.5753/sbqs_estendido.2022.227650.