Does TDD lead to earlier integration?

| 3 Comments
I'm developing a POP3 server. I've been developing the protocol handler test first and it's nearly done. I haven't started on the mailstore itself yet but I could easilly integrate the POP3 code into the server code and have a functional POP3 server...

Due to the test first nature of the development, the protocol handler talks to the mailstore via an interface that's passed to it. I don't have a real mailstore yet, but I could mock one up based on the mock mailstore from my test harness and pass this to the POP3 handler in the server. At that point I'd have a working POP3 server running off of a dummy mailstore. This could serve up a fixed set of test messages. This could be used as a demo of functionality to project stakeholders, or as a server that client developers could work against. Of course, given it's just a POP3 server this isn't a big deal, but if it were a custom protocol it would be...

Normally I work to obtain a thin thread of functionality from front to back; more so if there are risky technologies at any point in the chain. So if I hadn't used TDD to develop the protocol handler I expect I would already have some of the mailstore in place (but less of the protocol handler). Of course TDD didn't preclude me from just implementing a couple of the more complex POP3 methods and pushing them all the way through to the mailstore, but it did force me to think about the design more; interfaces are there that probably wouldnt be there without the clarity of thinking that comes from using TDD...

3 Comments

Leave a comment