June 26, 2006

...Learn TDD with Codemanship

Waiter, There's A Bug In My Soup

You go to a restaurant and order ham and eggs. 15 minutes later the waiter brings you a cup of coffee and a banana split.

What kind of bug is that? Can it be avoided?

You go to a different restaurant and order ham and eggs. They bring you burned ham and raw eggs.

What kind of bug is that? Can it be avoided?

You go a third restaurant and order ham and eggs. They bring you ham and eggs - cooked to perfection. At this point you decide that you're not actually that hungry and ask them to bring you a cup of coffee and some French toast instead.

Is that a bug? Can it be avoided?

I think it helps to get these different cases straight in our minds before we start talking about bugs.

The first bug is a requirements defect, most probably. The customer asked for one thing, but the order got mixed up or the waiter wrote down the wrong thing. A good way to avoid this kind of bug is to have the customer give their order directly to the cook. It also helps to give feedback to the customer when you take the order - read it back to them and double check the order is complete and correct. Some establishments that serve particularly complicated dishes - like beef burgers and kebabs - use pictures to help the customer visualise what they're going to get, as well as help the cook visualise what the finished dish ought to (at least vaguely) look like.

The second bug is inexcusable. The order is understood, so the cook has a clear specification of what's required. He just cooks it wrong. Arguably he's not a very good cook. The cook shouldn't have cooked it that way. And the waiter certainly shouldn't have delivered it to the customer.

In both of these cases, the customer should not be expected to pay. But in the final example, the waiter and the cook have completely fulfilled the order. They cannot be expected to know that the customer will change their mind. But, like gracious hosts, they should accept that the customer has changed their mind and do an equally good job of making coffee and french toast. Then they add it to the bill along with the original order.

How complicated is that?
Posted 14 years, 6 months ago on June 26, 2006