Using natural language processing techniques for automated code refactoring
| Ano de defesa: | 2023 |
|---|---|
| Autor(a) principal: | |
| Orientador(a): | |
| Banca de defesa: | |
| 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. |
| id |
USP_3384b61e73b60b287394a3ffe4280703 |
|---|---|
| oai_identifier_str |
oai:teses.usp.br:tde-18012024-163530 |
| network_acronym_str |
USP |
| network_name_str |
Biblioteca Digital de Teses e Dissertações da USP |
| repository_id_str |
|
| spelling |
Using natural language processing techniques for automated code refactoringUtilizando técnicas de processamento de linguagem natural para refatoração automática de códigoAprendizado de máquinaCode refactoringEngenharia de softwareMachine learningNatural language processingProcessamento de linguagem naturalRefatoraçãoSoftware engineeringNatural 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.Técnicas de processamento de linguagem natural podem ser aplicadas aos mais diversos textos, não somente àqueles redigidos em linguagens humanas como também àqueles redigidos em linguagens ditas artificiais, como códigos escritos em linguagens de programação. Refatoração de código é uma técnica fundamental em engenharia de software, sendo utilizada tanto como uma ferramenta para garantir a qualidade do código como também como um passo importante na expansão de funcionalidades e depuração. Nesse trabalho propomos um modelo para refatoração automática de código. Ao utilizar diretamente o código fonte como entrada em nosso modelo de processamento de código nós obtemos automaticamente sugestões de refatorações do tipo extração de função. O modelo proposto consiste em uma rede neural capaz de receber uma representação vetorial do código a ser refatorado e gerar uma representação da refatoração sugerida. Essa rede foi treinada com base numa lista de repositórios de código obtida através de uma colaboração com a TU Delft na Holanda. Com base nessa lista foi criado o maior dataset de refatorações de extração de função existente --- até o momento da publicação dessa tese --- sendo 60% maior do que o segundo maior dataset de seu tipo. Além disso, nosso modelo final atingiu uma acurácia de teste de 0.7275.Biblioteca Digitais de Teses e Dissertações da USPFinger, MarceloBarzilay, Alan2023-09-01info:eu-repo/semantics/publishedVersioninfo:eu-repo/semantics/masterThesisapplication/pdfhttps://www.teses.usp.br/teses/disponiveis/45/45134/tde-18012024-163530/reponame:Biblioteca Digital de Teses e Dissertações da USPinstname:Universidade de São Paulo (USP)instacron:USPLiberar o conteúdo para acesso público.info:eu-repo/semantics/openAccesseng2024-01-18T20:45:02Zoai:teses.usp.br:tde-18012024-163530Biblioteca Digital de Teses e Dissertaçõeshttp://www.teses.usp.br/PUBhttp://www.teses.usp.br/cgi-bin/mtd2br.plvirginia@if.usp.br|| atendimento@aguia.usp.br||virginia@if.usp.bropendoar:27212024-01-18T20:45:02Biblioteca Digital de Teses e Dissertações da USP - Universidade de São Paulo (USP)false |
| dc.title.none.fl_str_mv |
Using natural language processing techniques for automated code refactoring Utilizando técnicas de processamento de linguagem natural para refatoração automática de código |
| title |
Using natural language processing techniques for automated code refactoring |
| spellingShingle |
Using natural language processing techniques for automated code refactoring Barzilay, Alan Aprendizado de máquina Code refactoring Engenharia de software Machine learning Natural language processing Processamento de linguagem natural Refatoração Software engineering |
| title_short |
Using natural language processing techniques for automated code refactoring |
| title_full |
Using natural language processing techniques for automated code refactoring |
| title_fullStr |
Using natural language processing techniques for automated code refactoring |
| title_full_unstemmed |
Using natural language processing techniques for automated code refactoring |
| title_sort |
Using natural language processing techniques for automated code refactoring |
| author |
Barzilay, Alan |
| author_facet |
Barzilay, Alan |
| author_role |
author |
| dc.contributor.none.fl_str_mv |
Finger, Marcelo |
| dc.contributor.author.fl_str_mv |
Barzilay, Alan |
| dc.subject.por.fl_str_mv |
Aprendizado de máquina Code refactoring Engenharia de software Machine learning Natural language processing Processamento de linguagem natural Refatoração Software engineering |
| topic |
Aprendizado de máquina Code refactoring Engenharia de software Machine learning Natural language processing Processamento de linguagem natural Refatoração Software engineering |
| description |
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. |
| publishDate |
2023 |
| dc.date.none.fl_str_mv |
2023-09-01 |
| dc.type.status.fl_str_mv |
info:eu-repo/semantics/publishedVersion |
| dc.type.driver.fl_str_mv |
info:eu-repo/semantics/masterThesis |
| format |
masterThesis |
| status_str |
publishedVersion |
| dc.identifier.uri.fl_str_mv |
https://www.teses.usp.br/teses/disponiveis/45/45134/tde-18012024-163530/ |
| url |
https://www.teses.usp.br/teses/disponiveis/45/45134/tde-18012024-163530/ |
| dc.language.iso.fl_str_mv |
eng |
| language |
eng |
| dc.relation.none.fl_str_mv |
|
| dc.rights.driver.fl_str_mv |
Liberar o conteúdo para acesso público. info:eu-repo/semantics/openAccess |
| rights_invalid_str_mv |
Liberar o conteúdo para acesso público. |
| eu_rights_str_mv |
openAccess |
| dc.format.none.fl_str_mv |
application/pdf |
| dc.coverage.none.fl_str_mv |
|
| dc.publisher.none.fl_str_mv |
Biblioteca Digitais de Teses e Dissertações da USP |
| publisher.none.fl_str_mv |
Biblioteca Digitais de Teses e Dissertações da USP |
| dc.source.none.fl_str_mv |
reponame:Biblioteca Digital de Teses e Dissertações da USP instname:Universidade de São Paulo (USP) instacron:USP |
| instname_str |
Universidade de São Paulo (USP) |
| instacron_str |
USP |
| institution |
USP |
| reponame_str |
Biblioteca Digital de Teses e Dissertações da USP |
| collection |
Biblioteca Digital de Teses e Dissertações da USP |
| repository.name.fl_str_mv |
Biblioteca Digital de Teses e Dissertações da USP - Universidade de São Paulo (USP) |
| repository.mail.fl_str_mv |
virginia@if.usp.br|| atendimento@aguia.usp.br||virginia@if.usp.br |
| _version_ |
1815258207072813056 |