I just finished reading Test-Drive ASP.NET MVC by Jonathan McCracken. What a refreshing and worthwhile book. As the title implies, the book covers both Test Driven Development (TDD) and MVC 2.0, as well as some other essentials of application development. Jonathan takes the reader through an end to end ‘experience’ of developing a full application called GetOrganized, a toolset inspired by Getting Things Done by David Allen.
When I say ‘experience’, what I mean is that this book is an end to end process of developing a complete application, using TDD principles right from the beginning. Jonathan didn’t take shortcuts. He starts all of his code with the test, makes sure that it fails, then writes the code and confirms that the test pass. If you want to see how a seasoned developer uses TDD in the real world, using MVC as a framework, and get an opportunity to get inside someone else’s head, this book is for you. Jonathan does a great job of showing why he does various things and the justification he uses on his various decision. I was constantly impressed with how he expresses his reasoning, and I felt that I had a good handle on how another developer thinks throughout the full lifecycle.
Who should read the book? This is meant for anyone with a programming background who wants to learn MVC 2.0 using TDD principles. Jonathan’s writing is very easy to follow and is almost conversational in nature, and it’s loaded with content and gold nuggets. He doesn’t waste words, but he doesn’t leave you guessing either. Jonathan does not target the beginner, so don’t worry about him speaking under you if you are already a confident programmer. Mind you, he does need to lay the right foundation for his entire audience, so fairly new programmers shouldn’t feel left behind either. Don’t pick up this book if you are brand new to programming though. Jonathan jumps in with both feet right from the beginning, assuming that you already have some foundation as a programmer. You can come from other programming languages and frameworks and have no problem keeping pace. Ruby, PHP and other programmers can easily step into MVC after reading Test-Drive ASP.NET.
This is not a reference book. While there is a good index in the back, this isn’t a complete reference of MVC or TDD principles. There are many aspects of MVC and TDD that aren’t covered. It’s not possible to do so within 250 pages, but it covers everything necessary to get up, fully running, and more. When you’re finished the book, you will feel that you have a solid handle on TDD, how to use it in the real world, have a solid handle on MVC and how to properly write your unit tests for MVC 2.0.
If I were to recap the top 10 sections that are covered, I would say that they are: 1) Working with M.V.C. … in other words, working with models, views and controllers 2) maintaining state, 3) HTML Helpers and Master Pages 4) Form validation 5) Ajax, Partial pages, JQuery 6) NHibernate 7) IoC and further integration of repositories with controllers 8) RESTful Web Services 9) Security, Error Handling and Logging, 10) Build and Deployment.
I found this a worthwhile read and I highly recommend it for anyone looking to get into Test-Driven development using MVC.