in reply to Code Generation from Test Suites
You're talking about using Perl to write an ad-hoc programming language more suited to writing your tests than writing in Perl directly. After all, if you can describe your problem in a way that a computer can solve it, your description is a program, and the process that translates it is a compiler/interpreter.
This is essentially all test driven development does; one produces a (partial) definition of a simplified subset of program behaviour called "tests" (which is hopefully simple enough to be correct), and a second, authoritative definition of program behaviour, called "the program". If the two definitions are inconsistent, you have a problem; one of them is wrong (probably the program, but possibly the test suite).
Once you specify your tests so completely that they're your program, you've hopefully written a simpler program. Then the question becomes: can you write the tests in an even simpler, more obviously correct way using the new programming language you've just developed? It never ends...
|
|---|