October 04, 2003

Does TDD lead to earlier integration?

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...


Share this entry: Email it! | bookmark it! | digg it! | reddit!

Posted by Len at October 4, 2003 12:16 PM | Comments (3) | Categories : Testing
Comments

Why?

Posted by: Daz at October 6, 2003 01:08 PM

Why what?

Posted by: Len at October 6, 2003 01:10 PM

Why not? ;)

Posted by: DrB at October 6, 2003 10:07 PM
Post a comment









Remember personal info?




Enter this code in the box below to prove that you're not some kind of automated spam robot...