2 ms·
I often find that before I've diagnosed and fixed a bug, I don't know what the best test is. So I tend to: fix the bug; write the test; see the test fail on th
by parenthesis 6y ago
I often find that before I've diagnosed and fixed a bug, I don't know what the best test is.
So I tend to: fix the bug; write the test; see the test fail on the old version of the code; see the test pass on the new version of the code.
Something else I'll throw in on tests. Many times I've caught a bug I would otherwise be introducing because an existing test — which wasn't written to catch my new mistake — fails.