But the costs of refactoring are differing in environments which do or do not support some basic principles used for refactoring.
On the language/environment side it depends on how well the operations on the source code are supported (see 1.7.4, p.
). But in general the cost of applying the basic text modifications should be bearable.
As refactoring relies heavily on testing after each small step having a solid test suite of unit tests for the whole system substantially reduces the costs which would be implied by testing manually (if this is possible at all).
The costs of updating documentation of the project should not be underestimated as applying refactorings involves changes in interfaces, names, parameter lists and so on. That results in the change of the overall design of the system. All the documentation concerning these issues must be updated to the current state of development. Better off are development practices like XP which don't rely that much on external documentation but instead use the source code as main input for that.
The tests covering the system need an update as well as the interfaces and responsibilities change. These necessary changes can contribute to higher costs as tests are mostly very dependent on the implementation. Because between the steps of refactorings old interfaces are first kept and later gradually extended by the new ones, all tests should run without modification within the time frame of the refactoring. But afterwards when the old interfaces are removed in favor of the new ones the test have to be updated as well.