Spreading the Infection

cruizer raised a thread on the forums:  Suggest a good demo for TDD for .NET MSDN Event. I wrote this as a reply on his thread.


I've also done a few short courses about TDD. Despite my mediocre communication and delivery skills, attendees still rate the courses highly (I think they don't want to hurt my feelings). But I'm most concerned about this question: How can I apply it to my project? You've shown us a program for scoring bowling games. So what? I'm not writing that type of application. Wow, now I know how to convert numbers to words. Btw, we have an existing library that does that. It can also handle different languages so you can print cheques in french, german, chinese and with a few configuration changes, even alibata. My application has a UI. It writes to a database. It accesses a web service. It employs some wierd calculations that depending on some random user input. How can TDD help me there? Do you have a demo about that, too?

From the feedback that I got from the attendees, I've dreamed up this training course.


The scenario is this: you are one of the developers of on ongoing application designed using TDD. You've got a new team member [pick someone in the audience to act as the new guy] and he is given a task: to implement a new piece of functionality [estimated to take about an hour or two] and add it to the application. As a new joiner, he knows nothing about the application. As one of the developers of the application, you are responsible for introducing him to the team practice of test driven development. You are going to pair with him and help him implement the new functionality. You will initiate the discussion by writing the first test and he will try to implement them. If he is stuck, you'll switch places. The other attendees watch and learn along with your (hopefully) willing victim.

Pros: 

  1. It is a real world example involving an existing application. Attendees would immediately see the benefit of TDD in terms of how it helps in the design of the new functionality.
  2. Attendees would see a clear benefit of maintaining a large number of running tests.
  3. They'll have an existing application to refer to whenever they want to know something about TDD. How do you test a database? How do you test the UI? What do tests look like? How many tests do I need to write? Show them the code and let them use it as a template.
  4. It is very interactive. It no longer matters if other attendees feel sleepy because you've got the full attention of your victim.
  5. At the very least, one of the attendees would surely be able to guage how hard/easy it is to start doing TDD. You picked someone in the audience, a beginner, to have a hands-on designing and coding using TDD. If you happen to "infect" him too, that's good enough for me. :D

Cons:

  1. You need to write an application that you can demo or you need an existing application to use, probably, open source.
  2. It might be hard to direct. You are picking a random someone from the audience. This is no longer just a presentation. You can try creating a script and let your victim just read from the script but that would make this less real.
  3. It might take longer that time allotted to you. But I guess that's a good thing too.
  4. You might need some special hardware (handsfree mic and a good projector, for example) for this to work.
  5. I haven't tried this on a presentation yet, so it might not work. :D

Will this work? Add some nice, hot food and it surely will.

Published 09-29-2006 3:19 PM by jop
Filed under: ,

Comments

# re: Spreading the Infection

nice suggestion jop. thanks! i only have three days more to prepare, hehheh!

Sunday, October 01, 2006 4:26 PM by cruizer

# re: Spreading the Infection

Thanks. I'm sure you'll have another one in the future. :-).

Sunday, October 01, 2006 7:17 PM by jop