Refactoring without tests should be fine. Why is it not? When could it be safe?
Refactoring is a controlled technique for improving the design of an existing code base. Its essence is applying a series of small behavior-preserving transformations, each of which “too small to be worth doing”. However the cumulative effect of each of these transformations is quite significant.
Although the word “refactoring” is used by programmers in many different ways (often it just means “changing” the code), in this case I’m thinking of those small behavior-preserving transformations. The essence of those transformations is:
- The structure of the code changes (e.g. we add a method, a class, an argument, etc.), but
- The behavior of the program stays the same.

No responses yet