Test Driven Development

More and more I've been hearing about Test Driven Development and how amazing it is. I've seen a couple of talks about it and a couple of people from work have also mentioned it. So I thought I'd finally have a go and see what the fuss is about.

I bought Graham Lee's book - Test Driven iOS Development and it finally got me on the road. It was a long a winding road though. Although I understood what the code was doing it was difficult trying to understand why.

So I decided to just go ahead and start my own project and use TDD all the way.

Suddenly all the pieces fell into place. Although it was a slow process I suddenly felt a lot more confident in the code I was writing and found myself writing a lot less of it too.

I was concentrating on just getting the "back end" of my app working before doing anything else. This in itself is a new thing for me. Without TDD I'd normally have to get some sort of GUI onto the app in order to "test" the back end code. This would inevitably lead to changes back and forth between front and back end and end in a confusing mess of code.

OK, so eventually I got bored and wrote a little front end test to see how it all fit together.

BOOM! Suddenly my app was up and running. It ran first time without having to hack any code.

OK so I'm very early on in the learning process but I'm definitely getting there. Looking forward to learning the more advanced aspects of TDD now.

Comments are closed.