Tag Archives: XP

Refactor (Don’t Rejactor) Your Code

I believe that today’s team retrospective may have contributed a new term to the Agile lexicon: Rejactoring

While “refactoring” is the agile-embraced practice of improving the quality of the system without changing the system’s behavior, a “rejactoring” is a “refactoring” that “jacks up” the object of the refactor.  When a refactoring goes bad, it becomes a “rejactoring.” Rejactoring the code results in systems breaking in unexpected ways and at inconvenient times.

Here are some suggestions on how to avoid rejactoring your code:

  • Improve the code’s structure in a series of small increments, not one big change.
  • Have tests defined that will that give you quick validation that you have not inadvertently broken the current functionality.
  • Separate functional improvements from the refactoring effort. Combining a refactor with functional improvements is simply building new features, not a true refactor. Be careful not to bastardize the practice of “refactoring.”

For further reading on refactoring, check out Martin Fowler‘s book, Refactoring: Improving the Design of Existing Code as well as the site Refactoring.com.