3 ms·
You don't understand what for are tests. Tests don't give a shit if your code works today - you write them to freeze today's state of code (doesn't matter, if y
by EugeneOZ 10y ago
You don't understand what for are tests. Tests don't give a shit if your code works today - you write them to freeze today's state of code (doesn't matter, if your code correct or not).
- faragon 10y agoI do. My point is that not all code is of same kind. E.g. for the case you point, I do extensive unit testing for synchronous code with inputs and output/s that does significant stuff, in order to avoid breaking past things with new changes. You can check that I try to honor what I say, here: https://github.com/faragon/libsrt/blob/master/examples/stest.c https://github.com/faragon/libsrt/blob/master/examples/stest... However, there are cases where unit testing is not suitable, or it is not a guarantee, or it is an additional risk, e.g. event-driven or low level stuff, multithreaded code, etc.
- EugeneOZ 10y agoMultithreaded and async code needs tests even more! It's much more difficult to test, but it doesn't mean such code shouldn't be tested. Where code is complicated, chances to create unintended changes are higher.
- faragon 10y agoSure. I was arguing against "religion" ("put unit tests everywhere, for every single thing"), not as "anti tests". There are many kind of tests.