In doing this, a couple of things were revealed about the game. First, we wanted to make the tank and aliens all be the same size so we could put them on a grid. But then we saw that our bullet wouldn't fit that story, so we introduced the idea of relative sizes. We also realized that even though we drew the block, it was too complex for the first scenario and it would have to wait. Notice that as we started writing the scenario in English, there are mistakes, irrelevancies, and problems with the order. This is OK. The thing to remember is that all of this was done for the sole purpose of creating a recipe for a scenario we could test. That scenario is the following:
[TestMethod] public void TestSimpleKill() { // 1. Create a 15x10 board. // 2. Place a 3x2 tank at 1x8. // 3. Place a 2x2 alien at 7x3 heading west. // 4. tank shoots // 5. advance 4 turns // 6. not won // 7. advance // 8. win }
Now that we had the recipe, we could go about writing the code.
Here's your chance to play at home!
Now we want to point out that this requirements doc is much hard to understand than our story. For example, if you were to add more requirements (e.g. an alien also shoots) is that easy to determine whether we have complete requirements? It also takes much more effort to create and especially to tell if it is complete. People aren't made to handle requirement documents well but we are story-telling machines. We embrace this in our coding techniques. We'd also like to mention some of the tools discussed at the end. For remote collaboration we use: Skype (audio / video) VNC for screen keyboard sharing RDP (windows remote desktop) -- requires Windows 2003/2008 server for pairing. Source Control: TortoiseSVN TortoiseGit Developer Tools: Resharper CodeRush Testing Tools: MsTest (in Visual Studio Professional and up) NUnit NCover TortioseDiff Approvals Tests Approvals Tests CodeRush add-in Rhino Mock TypeMock If you try this scenario yourself, please leave a comment about your experience. Download the code and slides from the webcast here: Code: TddWithLlewellynAndMichael.zip Slides dmtdd.pdf Cheers -- Michael and Llewellyn
Posted in DevelopMentor | Screencasts | Talks | Unit Testing
A blog by Michael Kennedy
About: Michael is an instructor for DevelopMentor, a .NET enthusiast, an agile pioneer, an entrepreneur, a father of three girls, a husband, a student, and a teacher.
Explore Related Content
Concepts >> azure - Workflow - RESTful - Unit Testing - web - WCF - ASP.Net - MVC - LINQ
Tools >> Visual Studio ClickOnce IIS
Type >> Screencast - Tools - Article - How To - Course
@DevelopMentor_ @mkennedy @andrewclymer @bmaso @coloringinguy @danamiga @ellisteam1 @georgeshep @isidore_us @jason_diamond @markblomsma @marksm @mauricedb @mscottreed @pierrenallet @richardblewett @tonysneed @wallacekelly
Sign In