This post originated from an RSS feed registered with .NET Buzz
by Darrell Norton.
Original Post: Another TDD Sucess story
Feed Title: Darrell Norton's Blog
Feed URL: /error.htm?aspxerrorpath=/blogs/darrell.norton/Rss.aspx
Feed Description: Agile Software Development: Scrum, XP, et al with .NET
It’s so easy to work with Test Driven Development. For example, I recently had to go in and debug a data access method. Well, I was supposed to just add tests for it, but I ended up having to debug it. Hehe.
There were 3 DataTables, so instead of testing all three at once and trying to figure out the error I was getting, I commented out two and just returned the first one in the DataSet. Green!
Ok, then I enabled the call to the database for the second one. Red! So I looked at the stored proc and typed dataset, quickly figured out it was a mapping issue, and fixed the stored proc. Run NUnit again. Green! Finally I re-added the last DataTable code and ran NUnit. Green!
All done and no debugger was necessary (sorry John Robbins!). And this only took a couple of minutes. All it takes is for you to start using TDD where you can. Just start by writing some tests around some code that you work with every day. I guarantee it will help.
This Blog Hosted On: http://www.DotNetJunkies.com/