2 ms·
As stated tests are important, what varies is the style and ordering of writing them. I don't like brittle tests that are specific to the implementation, such
by karmakaze 7y ago
As stated tests are important, what varies is the style and ordering of writing them.
I don't like brittle tests that are specific to the implementation, such as assert that such-and-such isn't invoked--an equivalent function can be invoked and pass.
The order I do things:
- think about the problem space, come up with some shape(s)
- list the test cases, but don't write the bodies
- code the happy path and runtime errors for others
- write the test bodies, make them pass
- clean-up any remaining placeholders
Sometimes (2) and (3) are flipped, more often interleaved