In contrast to the Agile SharePoint development with Scrum session this was very light on the slides. In good Agile tradition I adopted a Pair Programming approach with me at the keyboard and the audience been my code buddy. Everyone was provided with a copy of Uncle Bobs Three rules of TDD to help with during the pairing process. The rules state:
- You are not allowed to write any production code unless it is to make a failing unit test pass.
- You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.
- You are not allowed to write any more production code than is sufficient to pass the one failing unit test.
I did have some slides to set the scene (see below), to give some background to TDD and raise the issues around the use of the word TEST. We also looked at 10 reasons TDD sucks, with a slight SharePoint slant, and quickly got into Visual Studio where the real learning was to happen.
The user story was to develop a Magic 8 Ball web part that could have custom answers defined in a SharePoint list. The finished code is available on CodePlex and it is planned to extend this solution over time to expand on the ideas. My main issue with just getting the finished code is the learning is in the process and it can be hard to see how the design was driven by the code. I am planning to do a web cast on this to show this process.
CodePlex project now available http://www.codeplex.com/sp8ball
Each of you will receive a free license for Isolator for SharePoint, for those that did not win Typemock are running a special discount.