Someone once sent the following comment on the slides of a TDD classroom training I had done for his company (that someone wasn't attending himself and just checked out the slides from their intranet):
When thinking about TDD I always think about Kent Beck sentence "throw away all my production code but keep my test code" (not verbatim), the principle is that it should be possible to generate production code on the basis of only test code.
Which raises the question, has anyone tried that? While I'm pretty suspicious about such an idea scaling up to "real" systems, it would be interesting to read about academic experiments or something like that. Would it be even theoretically feasible to generate seemingly random bytecode until all the tests just happen to pass (and we'd know we have a working implementation of the system as described by the tests)?







