Wednesday, June 11, 2008

False Requirements

A giraffe
Suppose you are assigned to design a system that should carry out people from place to place, and occasionally let's say once in ten years, would have to travel a giraffe. It's tricky, but you may be able to come out with some strange car with a very high ceiling, working out the balance and stabilization. It may not be so economic, but who is going to be piker when it comes to carrying giraffes. (One can of course suggest a car without a ceiling at all, which might be a good solution, but one of the other requirements rejects a convertible.)

It turns out that we are often bending and twisting simple systems just to carry the giraffe. And in many cases when digging into, we find out the giraffe was not even in the formal requirements to begin with! It grew in somewhere, in one's imagination, and became an important part of the system. Oh, how much we could have saved without this giraffe, and the system could have been much simpler...

Let the giraffe travel on its own!

If it was in the original requirements, go back to the system analyst or the guy who wrote the requirements and ask him: do you really need this giraffe thing? maybe we can send him with another vehicle?

Giraffes are nice, but don't let them into your system.
Unless you want to run a zoo.

1 comment:

Moshe Sambol said...

You make a good point that it's hard to believe these are both equally serious requirements, but even if we imagine for a moment that they are, there is more going on here.

A fundamental principle of Object Oriented Design is Cohesion - "how closely a class or a module supports a single purpose or responsibility," in the language of "Head First Design Patterns" (a really great book).

It is a generalization of the principle of Single Responsibility - "A class should have only one reason to change."

Your post is a perfect example of a violation of these principles. Designing a car to transport humans 99% of the time and a giraffe once every so often is designing a component with two unrelated responsibilities.

Those responsibilities should be split apart and addressed by separate components. Then, when you realize the giraffe wasn't a real requirement to begin with, you can dispose of that component easily without touching the human transportation.