Skip to main content

Timeline for Should one test generated code?

Current License: CC BY-SA 3.0

17 events
when toggle format what by license comment
Jun 27, 2017 at 21:57 history tweeted twitter.com/StackSoftEng/status/879821014863155200
May 4, 2017 at 22:03 comment added BobDalgleish You completely missed my point. The output from the code generator may be perfectly correct, but it may not meet the needs of the project you're on. Also, the input to the code generator may have changed and the results changed accordingly. You have a similar situation when you upgrade your code generator and need to make sure it works in your current environment.
May 4, 2017 at 16:50 comment added Frank Hileman @BobDalgleish What you describe should be a unit test for the code generation engine, not the generated code.
May 4, 2017 at 10:44 answer added Phill W. timeline score: 1
May 3, 2017 at 21:16 review Close votes
May 8, 2017 at 3:03
May 3, 2017 at 21:08 answer added ArtGod timeline score: 1
May 3, 2017 at 20:11 comment added BobDalgleish Not really unit-testing compilers so much as testing the assumptions that went into the original original sources. For instance, one group might define an enumeration one way and another group another way. Checking to see that the translation process goes correctly to and from the generation code is essential.
May 3, 2017 at 19:45 comment added Frank Hileman @BobDalgleish good point; are people unit-testing their compilers?
May 3, 2017 at 19:30 answer added Martin Maat timeline score: 6
May 3, 2017 at 18:48 answer added Telastyn timeline score: 5
May 3, 2017 at 18:13 history edited Justin R. CC BY-SA 3.0
Generalizing test type.
May 3, 2017 at 18:12 comment added BobDalgleish Generated source code suffers from the same issues as generated machine code, except that it is sometimes more readable. The assumptions of the people who put the inputs into the code generator need to be checked against the assumptions of the people who use the resulting code, whether it is the same person or not.
May 3, 2017 at 18:12 comment added Laiv If it's source code it should be tested. By unit tests or integration tests is debatable.
May 3, 2017 at 18:01 comment added Frank Hileman This is an extremely over-generalized rationale. Generated code can come from a multitude of sources.
May 3, 2017 at 18:00 comment added Frank Hileman The main implication is that the bug you find is in the code generator, not the generated code.
May 3, 2017 at 18:00 review First posts
May 5, 2017 at 16:54
May 3, 2017 at 17:57 history asked Justin R. CC BY-SA 3.0