14 Sept 2009
Review - The Art of Unit testing by Roy Osherove
I thought this book was excellent, but it came to me 6 years too late! If you're just starting out down the unit testing/TDD route then I would highly recommend you get this book and give it a read. It's broken up into 4 parts, each part building on the concepts from the previous part.
The first part sets the arena for the rest of the book by providing concise definitions of what Unit and Integration tests are, as well as introducing the reader to the concept of Test Driven Development (TDD). Part 1 ends with chapter 2 that walks the reader through an example of putting together their first unit test.
The second part then starts looking at ways of making your code loosely coupled so that you can test more effectively and start using Fake objects. Roy does this by introducing the concept of Dependency Injection (DI), otherwise known as Inversion of Control (IoC), and then how you can utilise DI to make use of Stub and Mock objects in your tests. The second part ends with the introduction of Isolation Frameworks and looks at how they can ease the complexity of using Stubs and Mocks in your Unit Tests.
The third part then starts moving in to the more practical side of Unit testing now that the groundwork has been established in the first 2 parts. Roy takes the reader through the various patterns that can be used for test classes and how you can utilise them in a Test Hierarchy. Roy highlights that a Automated Build process is essential for running your test regularly to pick up any breaking changes that may have occurred in your app. Chapter 7 then moves onto the critical area of how to write tests that are maintainable, trustworthy and readable.
The final part is aimed at the the devs out there who are coming from existing organisations that don't do Unit Testing, but want to introduce it, or have started Unit Testing in their new app, but want to start Unit Testing their legacy code. Roy provides some good pointers on how to get Unit Testing accepted by teams less than eager to pursue new practices :)
The book also contains 2 appendices, one attempts to answer the question of how much testing should influence the design process and the second provides a good overview of the Isolation Frameworks, Tools and Test Frameworks currently available to make your life a little bit easier when you're testing.
Summary
If you're looking for a good book to get yourself, your fellow developers or team up to speed with good Unit Testing practices, then I'd highly recommend this book. If however you're a TDD guru, or have been unit testing for a while you probably won't get as much out of this as those who are new to Unit Testing.
11 Aug 2009
Upcoming events at NxtGenUG Southampton
Over the next couple of months we will be continuing our Web technologies theme by having Ben Hall down to talk about Testing ASP.Net applications on the 20th August. We’ve also managed to grab some uber swag from TypeMock and some of Roy Osherove excellent “The Art of Unit Testing” eBooks to give away! You can register here.
Then on 17th September we’ve got Yossi Dahan stopping by Southampton again, no BizTalk this time, but the new Windows Identity Framework! The Windows Identity Framework is Microsoft's offering for dealing with federated security. You can register here.
Then on 22nd October for our 2nd Birthday(!) we’ve hosting the follow up grudge match between Phil Winstanley and Sebastien Lambla as they duke out the merits of ASP.NET WebForms against ASP.NET MVC (and OpenRasta!). This was a very highly rated session in London, and promises to be very entertaining and informative. You can register here. More details to follow for this session on the site soon!
22 Jan 2009
An interesting video on Testing :)
Have a look here.
