3 ms·
In any other field, specifying a function by its value at a handful of points would be a bad joke. If you don't know what you want your code to do then tests w
by eutectic 11y ago
In any other field, specifying a function by its value at a handful of points would be a bad joke.
If you don't know what you want your code to do then tests will just make it harder to experiment, and if you do know then there's no harm in writing them after the fact.
- brlewis 11y agoWhen theseatoms says the specs already exist and the tests help, then you talk as if the test was the spec, it sounds like you're replying before you read.
- dllthomas 11y agoBench vices pin down a board at a handful of points. Other things about the environment (shape of board, material properties of wood) help me make sure it generalizes in the ways I care about.
- dragonwriter 11y ago> In any other field, specifying a function by its value at a handful of points would be a bad joke. There is a difference between making the spec explicit (which is providing concrete examples of the spec's meaning) and replacing the spec. You seem to be talking about tests doing the latter, while the grandparent comment talked about the former. > If you don't know what you want your code to do then tests will just make it harder to experiment, and if you do know then there's no harm in writing them after the fact. If different people are responsible for the unit under design vs. the parts of the software that will consume that unit, then the concrete examples provided by test cases can help confirm that there is a common understanding of the spec; as such, tests serve to validate the spec. You want to do that before you code the implementation. And once you've done that, the tests are also available to validate the implementation.