in reply to Re: Code Generators as tests.
in thread Code Generators as tests.
Smart generators may be able to avoid regenerating files that don't change; but many versions of "make" are dumb: they see the dependency in the DAG and follow it all the way up: they don't check to see if the output really changed at a given step.
I am not really suggesting that you put generated code in the source control system: I'm suggesting that you put source code in it. The fact that you used an automated partner to help you write that code is unimportant.
I am very aware of the the tendency for the checked-in and generated codes to diverge: that's what the tests are for. They fail when the two are different. At that point, there's a choice: either fix the test (i.e. the generator), or throw it away (the generator was just a wizard). --Dave
|
|---|