5 ms·
> I like to think tests are a way to implement twice and hope you got it right at least once. This to me is the biggest thing that makes writing good tests a "
by gwd 6y ago
> I like to think tests are a way to implement twice and hope you got it right at least once.
This to me is the biggest thing that makes writing good tests a "grind". For a simple, well-defined function, you can toss up a bunch of inputs and outputs and feel satisfied that all the corner cases work. For any moderately complex behavior, however, so far the only effective way I've found to test the behavior is to effectively duplicate the logic a second time in the testing code, and check to see that I got the same result; which is pretty discouraging when you're doing it.
It's certainly nice once it's done, though, to be able to make a change, re-run your test suite, and have a pretty reasonable confidence that nothing broke.