<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Books</title>
        <link>http://ryanrivest.com/blog/category/9.aspx</link>
        <description>Books</description>
        <language>en-US</language>
        <copyright>Ryan Rivest</copyright>
        <generator>Subtext Version 2.1.1.1</generator>
        <item>
            <title>Book Review: ASP.NET MVC 1.0 Test Driven Development</title>
            <link>http://ryanrivest.com/blog/archive/2009/09/24/book-review-asp.net-mvc-1.0-test-driven-development.aspx</link>
            <description>&lt;p&gt;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.&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;p&gt;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 &lt;em&gt;good&lt;/em&gt; thing!), that sometimes the process gets a little lost in the background.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.amazon.com/ASP-NET-MVC-Test-Driven-Development/dp/0470447621/ref=cm_cr_pr_product_top" target="_blank"&gt;&lt;img src="http://ecx.images-amazon.com/images/I/41g3WLv6asL._SL160_.jpg" /&gt; &lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Recently I picked up a copy of &lt;a href="http://www.amazon.com/ASP-NET-MVC-Test-Driven-Development/dp/0470447621/ref=cm_cr_pr_product_top" target="_blank"&gt;ASP.NET MVC 1.0 Test Driven Development: Problem - Design - Solution&lt;/a&gt; by Emad Ibrahim&lt;/p&gt;  &lt;p&gt;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 &lt;a href="http://www.amazon.com/Professional-ASP-NET-MVC-Wrox-Programmer/dp/0470384611%3FSubscriptionId%3D0JTCV5ZMHMF7ZYTXGFR2%26tag%3Dbrdicr-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0470384611" target="_blank"&gt;&lt;strong&gt;several&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;a href="http://www.amazon.com/ASP-NET-MVC-Action-Jeffrey-Palermo/dp/1933988622%3FSubscriptionId%3D0JTCV5ZMHMF7ZYTXGFR2%26tag%3Dbrdicr-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D1933988622" target="_blank"&gt;excellent&lt;/a&gt;&lt;/strong&gt; &lt;a href="http://www.amazon.com/Pro-ASP-NET-Framework-Steven-Sanderson/dp/1430210079%3FSubscriptionId%3D0JTCV5ZMHMF7ZYTXGFR2%26tag%3Dbrdicr-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D1430210079" target="_blank"&gt;&lt;strong&gt;books&lt;/strong&gt;&lt;/a&gt; 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.&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;p&gt;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.  &lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;&lt;img src="http://ryanrivest.com/blog/aggbug/12.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ryan Rivest</dc:creator>
            <guid>http://ryanrivest.com/blog/archive/2009/09/24/book-review-asp.net-mvc-1.0-test-driven-development.aspx</guid>
            <pubDate>Fri, 25 Sep 2009 04:04:19 GMT</pubDate>
            <wfw:comment>http://ryanrivest.com/blog/comments/12.aspx</wfw:comment>
            <comments>http://ryanrivest.com/blog/archive/2009/09/24/book-review-asp.net-mvc-1.0-test-driven-development.aspx#feedback</comments>
            <wfw:commentRss>http://ryanrivest.com/blog/comments/commentRss/12.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Book Review: The Art of Unit Testing</title>
            <link>http://ryanrivest.com/blog/archive/2009/07/03/book-review-the-art-of-unit-testing.aspx</link>
            <description>&lt;p&gt;I recently finished reading &lt;a href="http://www.manning.com/osherove/" target="_blank"&gt;The Art of Unit Testing&lt;/a&gt; by &lt;a href="http://weblogs.asp.net/rosherove/" target="_blank"&gt;Roy Osherove&lt;/a&gt; (published by &lt;a href="http://www.manning.com/" target="_blank"&gt;Manning&lt;/a&gt;).&lt;/p&gt;  &lt;p&gt;As the title implies, this book covers the topic of unit testing, which is still a mystery for a lot of developers. Unfortunately, I think that many believe unit testing to be a shadowy art that seems hard to &lt;a href="http://en.wikipedia.org/wiki/Grok" target="_blank"&gt;grok&lt;/a&gt;, and even harder to practice.  The truth is, it’s not as hard as you might think, and once you understand what unit testing truly is, you may find yourself enjoying writing your unit tests as much as your production code.&lt;/p&gt;  &lt;p&gt;The examples in the book are in .NET, so having an understanding of C# (or a similar language) will be helpful.  An understanding of .NET unit testing frameworks might be helpful as well, but it's definitely not necessary.  The book is ripe with great examples, and the author starts at the basics, so any developer should be able to understand unit testing with or without any sort of unit testing experience.&lt;/p&gt;  &lt;p&gt;The book is organized into four parts, which I have outlined below:&lt;/p&gt;  &lt;h3&gt;1. Getting Started&lt;/h3&gt;  &lt;p&gt;Roy sets the foundation with a great introduction to the basics of unit testing. He defines what makes a good unit test, and what the differences are between unit and integration tests.&lt;/p&gt;  &lt;p&gt;A brief introduction to Test Driven Development is also provided at the end of the first chapter. This is one area that I wish the book would have had more of an emphasis on, but I understand that the author didn't want to fray from the overall direction of the book.&lt;/p&gt;  &lt;p&gt;The second half of part one walks you through setting up your first unit testing framework – NUnit.  Then the author tells you how to write your first unit tests and run them with the NUnit GUI test runner.&lt;/p&gt;  &lt;h3&gt;2. Core Techniques&lt;/h3&gt;  &lt;p&gt;Obviously we're not always working with a perfectly decoupled system that was built with unit testing in mind, and we don't always have the luxury to work on &lt;a href="http://en.wikipedia.org/wiki/Greenfield_project" target="_blank"&gt;Greenfield projects&lt;/a&gt;. As developers, we spend a lot of time in the maintenance phase, making improvements to existing legacy code.&lt;/p&gt;  &lt;p&gt;This is testing in the real world, and where fake objects come into play.&lt;/p&gt;  &lt;p&gt;Roy introduces both kinds of fake objects - mocks and stubs. Prior to reading this part of the book, I didn't really know (or care) the &lt;a href="http://www.martinfowler.com/articles/mocksArentStubs.html" target="_blank"&gt;difference between a mock and a stub&lt;/a&gt;. But we are introduced to both sides of the spectrum, including handwritten mocks and stubs.&lt;/p&gt;  &lt;p&gt;There is also a great deal of time spent showing us how to refactor our designs to be more testable by including seams that allow us to easily swap dependencies with fakes.&lt;/p&gt;  &lt;p&gt;We can finally understand how to use Isolation (mock object) Frameworks by the end of chapter 5 - which is dedicated entirely to them. There's an abundance of examples showing us how to utilize Rhino Mocks to create our fakes, and some time is spent with TypeMock Isolator as well.&lt;/p&gt;  &lt;h3&gt;3. The Test Code&lt;/h3&gt;  &lt;p&gt;Personally, this was my favorite part of the book. I really enjoyed these chapters because it's not an area that I've heard a lot about.  What are the pillars of good unit tests? In the author's words, it means writing tests that are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Trustworthy &lt;/li&gt;    &lt;li&gt;Maintainable &lt;/li&gt;    &lt;li&gt;Readable &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I haven’t seen a lot of writing on the topic of unit test maintainability, and sometimes I wonder if it’s a second-class citizen. Fortunately, there's a whole part of the book dedicated to what good unit tests are, and how you should organizing your tests.&lt;/p&gt;  &lt;h3&gt;4. Design and Process&lt;/h3&gt;  &lt;p&gt;The conclusion of the book comes with an interesting twist that is a little less technical, and more political. The chapter is called: Integrating unit testing into the organization, and the author speaks from a number of experiences with unit testing and some tips for how you might successfully introduce it into your organization.&lt;/p&gt;  &lt;p&gt;If you've ever been in an organization that was starting to practice unit testing, you've probably seen how people initially react. It's one of those areas that is scary for a lot of people because they don't fully understand it. It's also hard to learn if you have no guidance, and it can significantly increase the development time for a project when you're starting.&lt;/p&gt;  &lt;p&gt;Fortunately, the author arms us with guidelines for successfully introducing unit testing into our organizations. There's also an entire section called "Tough questions and answers," that is devoted entirely to helping to predict the hard questions that you will undoubtedly face when starting to discuss unit testing at work.&lt;/p&gt;  &lt;p&gt;Finally, the last chapter is dedicated to writing tests for legacy code. Roy outlines a strategy for developing tests for existing systems that don't have any unit tests. He shows you how to prioritize the components based on different characteristics, so that you can figure out what to tackle first. Large legacy codebases can be overwhelming, and having a plan of attack will be greatly beneficial!&lt;/p&gt;  &lt;p&gt;Overall, I thought the book was excellent. It's a great front to back overview of unit testing, ranging from the absolute basics, to more advanced topics like test hierarchies, writing maintainable tests, and more.  I wish this book was around when I was just starting to unit test.  I’m recommending it to all of my friends – beginners and veterans!&lt;/p&gt;  &lt;p&gt;Learn more at &lt;a href="http://weblogs.asp.net/rosherove" target="_blank"&gt;Roy Osherove's blog&lt;/a&gt;, and the book website at &lt;a href="http://www.artofunittesting.com/" target="_blank"&gt;The Art of Unit Testing&lt;/a&gt;&lt;/p&gt;&lt;img src="http://ryanrivest.com/blog/aggbug/6.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ryan Rivest</dc:creator>
            <guid>http://ryanrivest.com/blog/archive/2009/07/03/book-review-the-art-of-unit-testing.aspx</guid>
            <pubDate>Fri, 03 Jul 2009 07:05:16 GMT</pubDate>
            <wfw:comment>http://ryanrivest.com/blog/comments/6.aspx</wfw:comment>
            <comments>http://ryanrivest.com/blog/archive/2009/07/03/book-review-the-art-of-unit-testing.aspx#feedback</comments>
            <wfw:commentRss>http://ryanrivest.com/blog/comments/commentRss/6.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>