Choosing The Right Tool
I had an interesting conversation with a development lead today. The conversation was about the need for unit testing in a project which was about to start.
I suggested that the project would benefit from thorough unit testing starting from day one. He, on the other hand, argued that it would not be necessary for this project. If it were up to him, he would settle for traditional testing at the end of each iteration.
When I tried to understand the rationale behind his stand, he used the following example (warning: misleading argument ahead…):
“Let’s say you are building a garden. You go to your local hardware store and ask for a garden hose so you can water your new plants. The salesclerk looks at you with a funny smile on his face and says: ‘why won’t you take this automatic watering system? It’s much better than a simple hose’.
How would you react? Will you automatically take it? Of course you won’t! It all depends on your needs. If you have a small garden, a hose will do just fine. If, however, your garden takes ages to water, you will clearly benefit from an automatic watering system.
You see, it depends on the context. Not every tool is right for every purpose. Sometimes, a garden hose is just good enough!”
That argument sounded awfully familiar. It seemed to make perfect sense, yet something just didn’t feel right. The reason this argument sounded familiar, is that I had used a similar argument a while ago in one of my blog postings. Because I really believe that most of our professional decisions are context sensitive, I found myself unprepared to that argument – “my stolen” argument.
It didn’t take me long, however, to understand how my precious argument had been misused.
The fact that practices, guidelines, and techniques are all context sensitive, suggests that we should thoroughly consider the context we operate in before making a decision. Please read that last sentence again. It says: “thoroughly consider”.
That’s the whole point of the context-sensitivity argument. It means you should not apply any practice, guideline or technique without considering its cost against its benefit in the given context. How? Based on your experience and the experience of others.
If anything, the garden hose example demonstrates the opposite. The development lead failed to do the required in-depth analysis. Had he done this analysis, he would have found out that no matter what your garden size is, an automatic watering system is better than a hose.
You see, it’s all a matter of cost and benefit. An automatic watering system doesn’t cost that much. But the best part is that soon it will save you money. Your watering expenses will soon drop. You will never forget to water your plants, condemning them to a painful dehydration. You will also never over-water any plant. The benefit of using such an automatic watering system is far greater than what it costs.
So where is the context sensitivity? That’s simple. The exact type and setup of a watering system does depend on the size of your garden, the plants you are growing and a bunch of other factors. This is where you should consider the optimal solution for the given context.
The moral of the story is this: don’t use the context-sensitivity argument as an easy way out of adopting some practice, technique or tool. You have to consider both your short-term goals and your long-term goals. Considering only your immediate goals will rarely result in an optimal decision. Carefully analyze the cost of each alternative and its benefit. You must have a complete picture in order to make the right decision.
Sometimes a garden hose seems good enough. But for most (if not all) gardens, you can do a lot better.











