Tuesday, June 7, 2011

Code And Prejudice

Let's take some work from Ms Austen.
It is a truth universally acknowledged, that a single man in possession of a good fortune, must be in want of a wife.
It's a classic opening sentence to a classic novel, and one with a clear meaning. Imagine that for some reason you wanted to take this rule and apply it to, for example, everybody in a neighbourhood. You hire a crack team of programmers to write the software so that you can plug in the personal details of your neighbours. Quite why you would do this I don't know, but work with me here. Let's see what misunderstandings could crop up.

In possession of a good fortune. Ambiguities are the seeds of defects and arguments about scope or intent. Obviously this needs to be clarified: what constitutes a good fortune? Is there a different threshold if discussing net worth compared to salary? Would different neighbourhoods have different ideas of what  constitutes a "good fortune"? Is a fortune just a monetary value? Questions easily answered, but questions which must be answered nonetheless.

It is  a truth universally acknowledged. One of the problems that occurs quite often is that the specifications contain outright mistakes, mistakes which are outside the developer's ability to recognise as such and which the client believe to be true. What if this rule is taken to a culture where a man can have many wives, or spouses are matched as children before a good fortune can be amassed, or the wife's family have to pay a dowry? Absolutes are great in specifications, but only if they're true.

A single man in possession of a good fortune. More subtle than ambiguities of definition are ambiguities of language. Although you might think it's pretty clear that the phrase means 'an unmarried man', other interpretations could be made. Maybe it's differentiating a good fortune possessed by one man from a good fortune possessed in common with several other men (say a business partnership). If the developer thinks that the alternative definition is pretty clear, then the first you'll know about it is when married men are being classified as in want of a wife.

Must be in want of a wife. Implied meaning can cause all sorts of problems when a requirement is broken down into its components. If the developer working on this part knows that earlier specifications refer to a single man, he is likely to correctly assume that a single man wants a single woman who will become his wife. Of course, marriage is entirely implied, as is the fact the woman in question is not a wife but rather is supposed to become one. In this more literal interpretation the man is looking for an already married woman.

So, in the worst possible case of interpreting this classic sentence you could end up with somebody who thinks that Jane Austen believes the following:
In every place in the world it is agreed by all people that a man (of any relationship status) who has a predetermined level of wealth which he doesn't hold in common with anybody else must be in want of a married woman for undefined reasons.
Now imagine what happens when you apply this to to a three hundred page design document written by people who have never even worked in the same building as a developer before.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.