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 automated code refactoring model utilizing a neural transformer architecture.By utilizing source code as input to our model we wish to obtain automated suggestions of 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 will be trained based on a repository of refactored code provided through a collaboration with TU Delft Holland, our partner institution for this BEPE project.Given the success attained in NLP tasks by the transformer architecture, we intend to explore its viability for code processing tasks, in particular for function extraction refactoring suggestions.
News published in Agência FAPESP Newsletter about the scholarship: