4 ms·
I've found that writing a unit test to verify it works at all is sometimes loads easier than manually running the app or whatever. At that point, just leave th
by xahrepap 6y ago
I've found that writing a unit test to verify it works at all is sometimes loads easier than manually running the app or whatever.
At that point, just leave the test and check it in.
- h0l0cube 6y agoI agree with this, kind of. Though I've found that keeping useless tests around doesn't always have 0 cost, same for any dead code. Often, though, you can verify that your code works using a REPL. I'm also a huge fan of how doc-tests in some languages that make the tests are part of the documentation, and neatly 'cohere' them to the function itself. At which point I'm happy to leave them in, as the tests-as-documentation are harder to miss, and are actually instructive.