Tuesday, September 25th, 2007

Test First, or Second?

Something I’ve been struggling with lately is how to reconcile a need for adequate TDD design whilst applying sound pattern-based architecture. I’m really beginning to see why TDD is making my designs much more coherent and maintainable, but using design patterns is second nature and typically doesn’t involve (at least for me) a deliberate effort to flesh out higher level tests. It seems like the TDD aspect kicks in somewhere between the "hey this mediator pattern is a good solution for this" and "I should probably be writing some tests before I get much more code banged out". Maybe the source of my discontent is a lack of discipline very early in the design phase, or maybe some hard-wired need to model with patterns first. Anyway, having recently become deeply interested in using Mock Objects as well as Behavior Driven Development (BDD), I am focusing a lot of cycles thinking about how they are actually just variations of a theme, namely, let the tests drive the rest. I’ve got a lot more to learn here, but I believe that a lot of my pain (and my customers’ too) can be reduced using some of these techniques.

Leave a comment » Filed under Uncategorized by bcraun at 23:46.