A comment on "A Test Double Dilemma"

Gary Bernhardt submitted his position paper for Simple Design and Testing Conference, which runs during my TDD course in Istanbul, so I can’t attend it. I had to comment on this:

[In my TDD practice with test doubles I’ve] [f]ound that, now that all code is 100% isolated, it’s almost impossible to refactor across classes with confidence unless I totally rewrite them.

I interpret his comment as though that disappoints him. I invite Gary, and you, to consider an alternative interpretation:

  1. Rewriting classes, rather than refactoring them, shows good compliance with the Open/Closed Principle, which encourages me.
  2. Needing to refactor across multiple classes, as opposed to re-implementing everything behind a given interface, probably indicates a layering problem, which I’d expect to notice with duplication in the isolated tests. That encourages me, because I like it when my tests expose design flaws to me.

Naturally, I’d need to see a specific example to better understand Gary’s perspective, but my blink reaction tells me that more incremental rewriting and less refactoring doesn’t necessarily point to a problem.

5 months ago
Comments
blog comments powered by Disqus
Blue Theme by David