An ex-colleague of mine was telling me about a situation that he experienced on a project recently whereby his team had written a comprehensive unit test suite for a component designed to generate XML files for consumption in another system. Their code passed all the unit tests, yet when they delivered the component to the … Continue reading What is Unit Testing not?
It’s been a while since I last posted, and I thought I’d write something that often gets overlooked when unit testing – what the boundary is for a given set of unit tests. When you write unit tests on e.g. a public method on a class, something that you need to keep in mind is … Continue reading Unit Testing – testing class contracts
I've recently been looking at Fitnesse and integrating it into our application in order to provide our BAs with more confidence in the code we deliver as well as reduce the time it takes for non-developers to test our code out. A lot of our application is data centric, with complex logic carried out under … Continue reading Fitnesse on .NET
The most common use of Unity Call Handlers (or Interceptors) is for cross-cutting concerns. I’ve demonstrated the use of such handlers in the past for things such as logging or caching. However, there’s another use for these handlers that allows us to build reusable blocks of business-related code that can be composed together to act … Continue reading Using Unity Call Handlers to compose logic
In my last post, I discussed in detail why exactly I don’t recommend the use of the Template for writing testable code. Here I want to illustrate an alternative to it, but before I do that, I want to talk about a more fundamental aspect of OO design. Inheritance vs Composition The way I see … Continue reading Why I Hate the Template Pattern – Part 2
We’ve all been there and done it – written some code that at the time seemed great but you look back on it and think “why!”. I’m hoping to save you from at least one of those situations today with a brutal dissection of the Template pattern. Seductively, it offers you a quick and easy … Continue reading Why I Hate the Template Pattern – Part 1
I was holding off on posting this, but read some other good blog posts which sort of went along similar lines to this so decided to post it now… What is a framework? Whenever you write a reasonably-sized application, you’ll probably end up writing some sort of bespoke “framework” in your application. When you start … Continue reading Over-egging a Framework