3 ms·
I 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
by faragon 10y ago
I 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.