Tuesday, October 25, 2005


Should results always be predictable? This question applies both in the development of services (e.g. with model-based development), and in the execution of services. In this post, I'm going to look at a few contrasting examples.

Lucky Search

My colleague Lawrence Wilkes discovered that if you type the word "failure" into Google, and click "I Feel Lucky", you get sent to the official White House biography of George Bush. I wonder if this trick works for everyone. I wonder if it still works when you are reading this.

Not having played with the "I Feel Lucky" button before, I had always imagined it was some kind of non-deterministic selection, although I was prepared to believe that sponsorship might influence the selection. Perhaps someone with a political axe to grind has sponsored the link from "failure" to the White House, or perhaps it's been placed by a Google insider with an interesting sense of humour.

[Update: Here is Google's official explanation]

Of course this kind of thing is not new. Many years ago, I used to work with an enquiry tool called Datatrieve. (I actually used it to build a data dictionary, but that's another story.) If you enquired on "wombat" you got taken to some amusing pre-coded stuff. I guess the programmers thought it was unlikely that anyone would really want to store data on marsupials, so it was a safe term to use for an inside joke.

If the "I Feel Lucky" link has been fixed, then it is more deterministic than the search function, which may produce slightly different results every time (because new web pages containing the word "failure" are added to the Internet every minute).

Predictable Service

Should a service be predictable - should you get the same results every time? Clearly it is hard to test a system composed of non-deterministic services. But there are at least two reasons why the service supplier may be unable or unwilling to provide a guarantee of predictability.

The service provider may be entitled to vary the behaviour of the service according to some context information (such as customer status), without being obliged to publish the basis of this variation.
The service provider may wish to avoid specifying certain aspects of the service (such as for example the exact response time) in order to preserve some flexibility in the delivery.

One aspect of predictability is fairness. Differentiated services can be used to give preferential treatment to your friends. (For example, an eBusiness website that offered different prices to different customers.) Such preferential treatment is more difficult to detect if there is some degree of deliberate randomness in the service behaviour.

So we have a loss of predictability for the service consumer, which yields flexibility and other business benefits for the service provider. Predictability and flexibility always benefit someone at the expense of someone else. (This is why SOA needs governance.)

Predictable Model Transformation

One view on Model-Based Development, strongly represented by Microsoft (see for example DevHawk) is that model transformation should be deterministic.

When you compile a given piece of C# code, you get the same IL output every time.

But there is an important caveat. If the platform changes, then of course you get a different output. That's always been one of the attractions of model-based development - that it is not restricted to a single platform.

And here's where it gets interesting. Because if the network is the computer (and why not?) then the platform is constantly changing. The greater the potential variety of the target environment, the greater the intelligence that might be required (perhaps embedded in the model transformation) to achieve the desired fit. And although such intelligence might be deterministic (under certain limiting conditions) it surely doesn't have to be.

So what is the value of this determinism, to whom? If we imagine the model transformation being carried out as a service, does its predictability make it more valuable, and why?

Determinism versus Flexibility

The key trade-off seems to be flexibility. If something is under-determined it leaves room for adaptation. But how is this adaptability governed, and in whose interest. And if we decide that determinism is a good thing in a particular situation, how is this to be guaranteed?

No comments: