Using natural language processing techniques for automated code refactoring

Detalhes bibliográficos
Ano de defesa: 2023
Autor(a) principal: Barzilay, Alan
Orientador(a): Não Informado pela instituição
Banca de defesa: Não Informado pela instituição
Tipo de documento: Dissertação
Tipo de acesso: Acesso aberto
Idioma: eng
Instituição de defesa: Biblioteca Digitais de Teses e Dissertações da USP
Programa de Pós-Graduação: Não Informado pela instituição
Departamento: Não Informado pela instituição
País: Não Informado pela instituição
Palavras-chave em Português:
Link de acesso: https://www.teses.usp.br/teses/disponiveis/45/45134/tde-18012024-163530/
Resumo: Natural Language Processing techniques can be applied to text in general, not only to human language but also to artificial languages such as software code. Code refactoring is a fundamental software engineering technique used both as a quality assurance tool and an important step in code correction and functionality enhancement. In this work, we propose a novel code refactoring model. By utilizing source code as input to our model we obtain automated suggestions of function extraction code refactoring in order to achieve better readability and attain good practices in general. The proposed model consists of a neural network that receives a vectorial representation of the source code and outputs a representation of the suggested refactored code. This network was trained based on a list of repositories provided through a collaboration with TU Delft Holland. Based on this list we created the biggest existing function extraction refactoring dataset --- as of the time this thesis was presented --- being %60 bigger than the second biggest dataset of its type. Furthermore, our final model achieved a test accuracy of 0.7275.