In the beginning, there was the computer, and it was huge; but simplistic in its abilities. White-coated folk fed it its simple instructions via toggle switches on a front panel. As computers became both smaller and faster, those toggle switches gave way to keyboards, the form of instructions that the computer could accept became more complex, and the concept of defining applications via programming languages were born.
Over the years, those programming languages, and the tools used to utilise them, have grown in sophistication. Ever larger tasks can now be undertaken by small teams of developers. As those tasks have grown in complexity, the simple approach of just using a programming language to express an application design has had to change too. These days, smart developers actually start with tests and the code follows. We have left the age of programming-language-driven development and entered an age of test-driven development (TDD).
Grand though the above might sound, we are only in the very early days of TDD. The tests drive (or at least guide) the developer, rather than driving the implementation and the tests often badly capture the requirements. As Mark Seemann put it in the tweet that sparked the conversation, “I envision a future of software development where tests are the specification, and working software is auto-generated to pass all tests”. Reading this, you might imagine a future where an intelligent computer takes those tests and generates the code from them. This misses the point though, as all that would happen there is that the AI becomes the developer. To really understand how this statement might come about, simply take a look at the life on our planet: the answer lies in their DNA.
Life on earth is extremely diverse and it is like this for a good reason: the environments within which life exists is itself incredibly diverse. Yet at the heart of a hyperthermophile bacteria‘s ability to survive temperatures well above 100°C; a giant redwood‘s ability to grow to 85m tall; and the amazing abilities of the human brain is simply variation in DNA. Variations in DNA supply variation in individual organisms and some variations fit an environment’s needs better than others. Life has evolved its complexity simply through environments imposing survival requirements and those best-fit individuals coping with the challenges imposed by those environments. Those best-fit individuals survive to pass on their DNA.
What does any of the above have to do with software development? The answer is evolutionary algorithms. It is possible to give an evolution system a set of requirements and allow it to evolve the solution. The downside to this idea at the moment is that such systems are really rather slow. However, one thing the last 70 years have taught us is that computers have been getting – and will continue to get – ever faster. In the last few years, we have gone from PCs having just one CPU core, to four or even eight (virtual) cores being the norm. Even if we imagine that number doubling just once a decade, in 100 years time, that puts the number of cores in a device at around 4000! Traditional software development techniques can find it hard to utilise so much parallel computing power, but being able to evolve thousands of solutions in parallel might speed up the creation of software solutions through evolution by many orders of magnitude.
Of course if we are to use evolution to create software, we need ways of specifying requirements in a way that the mindless algorithms within the evolution system can understand. As hopefully you have worked out by now, those requirements would likely be best expressed as precisely defined tests.
So imagine a future of software development: gone are the programming languages and development tools of today. In their place are tools for expressing and managing large numbers of requirements tests, an evolution-based solution generator and a test environment for testing the solutions against the requirements. True TDD would have arrived. It would be the only form of software development that made sense, for it would provide more robust solutions at speeds that “intelligently designed” systems created by humans could never hope to match.
If you use TDD these days to develop your code, you should be proud of the fact that you are possibly a pioneer of the entire future of software application development. Oh and of course, evolution tells us that the dinosaurs who aren’t smart enough to adopt this way of development are destined for extinction… 😉