TDD Challange

time to read 1 min | 74 words

How would you go about testing code that generate code? I can think of only those two approaches:

  • Compare strings - very fragile.
  • Compiling the generated code and test that - may be complex if what you are generating is basically helper code.

Anything else?