About Links Archives Search Feed Albums of Note

TDD, XSD and Codegen: Preface

Quite a few people have been writing about their exploits with Test-Driven Development over the past few weeks and months. Oren Ellenbogen [http://www.lnbogen.com/default.aspx] has been writing several articles on the basics of TDD [http://www.lnbogen.com/PermaLink,guid,a5bbaf25-ab41-42fc-8373-93616b697386.aspx] , Ron Jeffries [http://xprogramming.com/] has been TDD’ing a sudoku solver [http://xprogramming.com/xpmag/OkSudoku.htm], and Scott Hanselman [http://www.hanselman.com/blog/IntegratingRubyAndWatirWithNUnit.aspx], Phil Haack [http://www.haacked.com/category/19.aspx] and Roy Osherove [http://weblogs.asp.net/rosherove/archive/tags/Agile/default.aspx] continue to add more thoughts of their own to the subject. Roy has even started a blog [http://feeds.feedburner.com/ArtOfUnitTesting] on writing a book about test-driven development.

Given my attention deficient aptitude for getting distracted by something else before getting started on a project, Oren’s description of TDD as ‘Code little, think, code little’ seems good for me. And with the repeat test run feature now up and running in Jamie Cansdale [http://weblogs.asp.net/nunitaddin/default.aspx]’s TestDriven.NET 2.0 [http://www.testdriven.net/], using nUnit [http://www.nunit.org] in VS2005 is even easier than before.

I haven’t seen anyone work with XML in a TDD blogging series yet, so I’m going to TD-develop a .NET 2.0 app which extends the schema-to-class functionality in xsd.exe. I’ve picked this for a number of reasons.

I’m going to use the first few tests to

We can also bear in mind the simple condition that in these initial tests, our code should return the same as if we used xsd.exe on a schema file, so we can generate tests from that as well. Now some might invoke the first acronym of TDD - YAGNI - or ‘You ain’t gonna need it’, which may be true here, but as we’re also going to learn how schemas and code namespaces map to each other in the process, I’m happy to make the trade off.

Right then, onto the first test…

Posted on September 4, 2006   #Geek Stuff  

← Next post    ·    Previous post →