Refactoring software is a practice adopted during recent years within agile software development processes. Like all agile practices, refactoring is based on clear principles and rules that must be observed to improve the software production process.
In this chapter we'll see the main principles and rules about software refactoring. We'll see why and when we should do refactoring and also why sometimes we shouldn't do it.
There are four important reasons for introducing the refactoring practice in your production process: