Let’s do TDD–take #2

I’ve been preaching about the benefits of Test Driven Development (TDD) for a long time and for the last two years I’ve been trying to introduce the idea to my team with limited success – some of my co-workers embraced TDD while other “just didn’t get it”.
imageAt first I become frustrated and I’ve tried explaining more and more about it without any real success. When I asked several of my teammates why they fail to even try writing tests before code the answer usually was – “I would but I don’t have enough time for it right now” or “it’s a good idea but it won’t work with this feature”.
One day it hit me – why not get the team to do TDD in a natural environment where they can try it without fear of missing a deadline or writing bad code. And so I gathered the team together in one room for an hour and a half of “TDD training”.
For the exercise I’ve chosen a problem that is simple to solve in small iterative steps (TDD) but very hard to design up front.
The exercise I’ve used was a roman numeral to decimal convertor. it is a well known problem that luckily for me none of my team had the pleasure of solving in the past. 
The slides from this session are available here.
After a short introduction of the problem and a few slides on the subject of TDD I got the team to pair up and try and solve that problem.
image
It was a fun exercise and some of my co-workers got to try test first for the first time.
I loved the fact The pair that finished first really embraced the methodology. The cool thing is that one member of that pair refused to try TDD for the last year.
We had so much fun that we’ve decided as a team to have this kind of meeting every three weeks.

Happy coding…

9 thoughts on “Let’s do TDD–take #2

  1. Hi Dror,

    Do you mind to share the slides and problem you used? Could be usefull for everyone.

    Thanks

    Bart

  2. Just a suggestion..I think it's pretty standard (and a very good practice) that when you're writing a blog post series, you always provide links to the previous posts in the series at the top. Or bottom.

  3. This is an excellent question…
    I think it's too soon to know, but I got really good feedback from the team and I got some of them to use TDD for the first time. 

    Now I'm waiting to see if it has any impact.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.