Leftshift’s Weblog

Techniques to improve your code

TDT

We have been running coding dojos once a week after work for the last couple of months. They have proved a valuable learning resource and people have been attending even though we run them after work. They focus on one aspect of technology and past topics include implementing UML class diagrams, Ruby on Rails 101 and OO Principles.

One technique I have found valuable for running a session is to prepare a set of failing tests beforehand. I recently ran a dojo on LINQ and Lambdas. I started with a test for the simplest possible LINQ expression I could think of. I made the test pass [using the standard red, green, re-factor]. I then removed the code and stored it inside a Visual Studio Snippet for quick retrieval during the dojo. At dojo time, I gave a brief intro to LINQ and the project structure I provided. And then one by one talked through the tests and got the attendees to implement the code to make the test pass. This keeps people focused on a single problem and keeps scope down to the knowledge you wish to get across. The feedback I received post dojo was positive. I call this approach Test Driven Teaching [TDT] and I would definitely encourage you to try it if you are thinking of running your own dojo.

Advertisements

12 June 2008 Posted by | Coaching | , | Leave a comment