Taswar Bhatti
The synonyms of software simplicity
Tag: unit testing

There are certainly many ways to stub out dependency, using constructor injection, etc etc. Here is one way to quickly stub out ServiceLocator rather than implementing ServiceLocatorStub. Lets say you have code that uses a helper and the dependency is not quite the responsibility of that object but its the sub object that uses it. […]

Working Effectively with Legacy Code

In this Learn Series I am going to write about the Sprout Method which is in the book “Working Effectively with Legacy Code by Michael Feathers“, all I have to say is what a great book if you don’t have it, you should pick it up asap. Sprout Method is a technique that one can […]

Working Effectively with Legacy Code

This is part 2 of Extract and Override refactoring technique. You can find part 1 in my previous post. I am going to show another technique by using Factory Method to break dependency in your code. *WARNING* *WARNING* Before I begin I would like to say all these techniques are not the best design but […]


Resources Manning – Where one can buy the MEAP early release of the book Amazon – Sometimes cheaper than Manning for print books Art of Unit Testing Wiki Site -The wiki site for the book The book will be in print I think April 2009 as Roy mentioned in his blog if you wish to […]

Working Effectively with Legacy Code

When doing unit testing, one always comes to a point where there this “kind of hard” part to test since the part depends on something you might not have control over or depends on the functionality of the dependency to complete. In “Working Effectively with Legacy Code” by Michael C. Feathers talks about a dependency […]