Description
Legacy systems may have poor code quality, which makes its maintenance difficult, this problem is often called technical debt. In this context, this paper performs a study on agile refactoring practices and automated tests in the development of legacy software, in order to verify if, in fact these techniques can minimize the technical debt of the code. This paper is presented as a practical study in part of a real legacy system, applying refactoring techniques and automated testing. In the end, a comparative use of how it was before and how it was after the application of the techniques was carried out. The results showed that through refactoring techniques, it was possible to reduce the average number of lines of code per function by 40%, improving legibility and maintainability. With decreasing coupling and increased cohesion, it was possible to apply unit tests in 78% of the functions of a given file, proving that these techniques can indeed minimize the technical debt of the code in the medium and long term.