It is rarely possible to make code structured and easy to read from the very beginning. Sometimes programmers have tight deadlines to fulfill the set tasks, find bugs that must be fixed quickly, or perform last-minute maintenance. As a result, even if the code works correctly and has a well-assembled structure, it ends up being confusing.
Refactoring is the process of changing software in a way so that it does not compromise its functioning but improves its internal part. It is used to maintain a well-designed software even with the passage of time and the changes that it will undergo. With that in mind, to facilitate the understanding of this concept, we will demonstrate the main features of refactoring, the benefits of using it, and several techniques that, when used together, ensure a gain in productivity in possible maintenance of the source code.