Home » Archive

Articles tagged with: refactoring

design »

[8 Oct 2007 | One Comment | ]

There are two documents that I frequently visit when I’m refactoring code, the first is A Taxonomy for Bad Code Smells, which categorizes various smells in Martin Fowler’s Refactoring book. The other is this Smells to Refactorings PDF file, which lists all the smells and refactorings from Fowler’s book as well as from Joshua Kerievsky’s Refactoring to Patterns book.
I’ve been looking for something that lists the various taxa, the smells, and the associated refactorings in both books, thus consolidating the tables on both of these documents. I couldn’t find one, …

design »

[25 Jul 2007 | Comments Off on Don’t mercilessly refactor unit tests! | ]

I teach TDD courses, and one of the questions that inevitably pops up is whether you should refactor your tests. When it comes to eliminating duplication in tests, my threshold is very high. By that, I mean that the most important thing to me is readability. I want to read a test like a mini story: I set this up, I execute this, I verify that.
One of the biggest annoyances I encounter with experienced TDDers is when they decompose tests to the point where you can’t see what the …

process »

[15 Jan 2007 | One Comment | ]

Martin Fowlers discusses the term Technical Debt as what is introduced into your code when you take a quick, yet messy approach to developing something. Another way to think about technical debt is as the inverse of quality; in other words:
technical debt = 1 / quality
A word that I’ve often heard used to describe the action of incurring technical debt is sprinting (not to be confused with a sprint in Scrum). This is an analogy to sprint running (in the track-and-field sense) where developers are rushing to write code, often …