Personally, I spend almost all of my time refactoring. If a feature doesn't "fit" in my current design, it's going to be hard to test, so the test-effort tells me it won't fit.
When that happens, I stop. I usually delete the test outright. If I know it's going to be a really fast refactor, I'll comment it out for a few minutes.
Then I refactor. I refactor, refactor, and refactor some more.
Eventually, I will have addressed the problem - usually by creating the right abstractions or encapsulating something.
At that time, I can safely and easily introduce my new test and my new behavior. It's an expression of my philosophy that we should make work easier rather than work harder.
When I do this, the typical effort for a new behavior trends down in an asymptotic way.
The effort per unit of functionality as a product ages under two alternative strategies |