Ryan Rivest

  Home :: Contact :: Syndication  :: Login
  8 Posts :: 0 Stories :: 10 Comments :: 0 Trackbacks

Archives

Post Categories

Thursday, September 24, 2009 #

When I first discovered ASP.NET MVC, I was about to begin development on a brand new project at work.  Since I come from a more “pure” background of web development (not Web Forms), I immediately got excited when I heard about this new framework.  The pieces began to click in my mind.. *finally* an ASP.NET that doesn’t rely on the drag and drop experience and hide the true nature of the web, I thought.

Day after day I would read articles and watch conference videos about this new and exciting way to build web apps with ASP.NET.  Around the same time, I started learning about unit testing and Test Driven Development (TDD).  It just so happens that the authors of ASP.NET MVC designed their framework with testability as a first-class citizen, so TDD is a natural fit.  So natural, in fact, that you were sometimes hard-pressed to find an introduction to ASP.NET MVC without a cameo by TDD.  Often people wondered whether you were required to use TDD to build apps with ASP.NET MVC.

Everyone mentions how well the framework lends itself to TDD, but few actually explain how you would go about building an application with TDD straightaway.  Steven Anderson’s book Pro ASP.NET MVC has a great introductory tutorial for building a working application with a test-first approach, but his book is so in depth (a good thing!), that sometimes the process gets a little lost in the background.

Recently I picked up a copy of ASP.NET MVC 1.0 Test Driven Development: Problem - Design - Solution by Emad Ibrahim

This is the book that I have been waiting for since ASP.NET MVC came out.  I’ve already read books explaining the details of ASP.NET MVC, so I wasn’t looking for another book to explain every aspect of the framework.  This isn’t an in-depth book on TDD or ASP.NET MVC, so if you’re looking for reference material on ASP.NET MVC, I recommend you look elsewhere, as there are several excellent books that have been out for a while.  I’ve had the pleasure of reading all three of the books I linked, and they’re all very good, in-depth technical resources if you’re looking for a book to explain every aspect of the framework.

ASP.NET MVC 1.0 Test Driven Development is essentially a ~260 page tutorial for building an application with ASP.NET MVC using the TDD process.  Some familiarity with both of them is necessary to get the most of this book.  If you’re not at least mildly comfortable with unit testing, you will have a problem reading this book.  The same goes for ASP.NET MVC.

The theme is centered around a bulk email/newsletter distribution web application called EvenContact and the author takes us through the entire development process, starting with the high-level requirements for what the application needs to do. 

This was the first Problem – Design – Solution title I’ve read from Wrox, and I really appreciated the structure of each chapter.  It highlighted the goals for each chapter by defining what the requirements were for a certain feature, the high-level design, and the author’s implementation.  It made things really clear.

Even though it was surface level, I enjoyed the overview of methodologies and design patterns in chapter 1.  It was a good introduction to the tools and practices that he would be using throughout the book, and I appreciated the introduction, which would be perfect if I had not seen the patterns before.

There were some artifacts left behind from pre-release versions of ASP.NET MVC 1.0 that I would have liked to see accurately reflected in the text.  Luckily for me, it was a non-issue because I followed most of the development changes from the CTP’s, but I can see this being confusing to newcomers.

One other important point to note – if you’re the type of person who gets lost easily when details are left out, this may not be the book for you.  The author leaves out a lot of fluff when he’s explaining new concepts and features.  Personally, I appreciated not having to go through the same steps for every single new feature in the application, but it may be something to consider for you.  I should also note that because of this fact, there are a lot of features that appear out of thin air in the text.

Even with the author’s intent to keep the book interesting by not repeating the same steps, the book does feel a bit repetitive.  We end up seeing the same tests repeated often for each new feature, and I found myself skim-reading through a lot of the second half, because it was things I had seen in the book already.

There were quite a few other typos and errors here and there in the text as well, which was surprising for a published book, but I guess it’s acceptable for a first edition.  Nonetheless, looking past the nitpicking, I still feel that it was a pretty good book, and may be a good reference for the combination of TDD and ASP.NET MVC.  There were definitely some takeaways that I got from the book and will be putting into use immediately.