Whilst falling asleep last night I had a thought - the suite of tests in a Test Driven Development project actually forms a fitness function, one that determines how fit-for-purpose the system they're associated with is.
That, in itself, isn't really a revelation. But one of my other interests is anthropology and evolution. And as soon as I thought of the term "fitness function", I started considering the implications. In the real world, a fitness function can determine whether or not any organism can survive. In principle, the same is true of a full acceptance-test suite for a computer system. So, if generations of organisms can mutate of their own accord until they meet the requirements of a fitness function (or become extinct), then that rule should also apply to computer systems, shouldn't it?
The idea of evolutionary software isn't a new one - I did a little work on genetic algorithms at university, and there's a good book called Virtual Organisms I once read on the subject - those are both going back a few years back now. But the thought of us already being in a place where it's feasible to do this, and with the current development practices is new to me at least.
As always, there's a problem... you can pretty much guarantee that you don't have 100% test coverage of your system. Basically, not all of your requirements are captured in tests. Aesthetics are the first things to get missed, followed by other areas such as security and performance. Without tests for all requirements, an ideal (or even acceptable) solution will never be met. For instance, imagine the fitness function for surviving on the African Savanna. It would consist of the ability to withstand prolonged heat, ultraviolet exposure, periods without food and water, and so on. What about the requirements for co-existence, though? The ability to outrun a cheetah, or duck from an eagle. If just one requirement isn't captured, the virtual function won't define the real-world success of an organism. Just as the programmatic tests won't define the real-world success of an organism if a business-requirement is ommited.
So, will this ever be possible? With some technologies that have been stretched beyond their initial purposes, probably not. HTML is a lousy way of creating dynamic interfaces, so the effort required to be able to capture 100% of UI requirements in tests is unlikely to pay dividends, meaning manual development. But with the new Avalon technologies in Windows Longhorn and other similar approaches, programmatic testing of the UI is more feasible. Similarly, security tests for buffer overflows, etc. are becoming less of a requirement as platform support is built in.
It may not happen for many years, if ever, but just imagine the day where you define precisely what you want your system to do, go and make a coffee, and come back to find it's evolved for you and has interacted with other virtual organisms to deploy itself to a live environment.