5 ms·
Much of the time, once my code is the way I want, there's almost nothing to test. Any tests I write would just be an echo of the implementation itself. I think
by feoren 4y ago
Much of the time, once my code is the way I want, there's almost nothing to test. Any tests I write would just be an echo of the implementation itself. I think if you're using your static type system to its fullest and writing clean, "obviously correct" code, 80% of your tests are simply not necessary at all. It goes:
- Bad code: almost no tests.
- Good code: lots and lots of tests.
- Great code: almost no tests.
- whakim 4y agoThe type system does help a lot, but I find the tests matter more for the next engineer(s) who need to touch your code. Modifying code you didn't write and don't 100% understand while being sure you didn't break existing features is priceless.
- rajin444 4y agoTesting is to ensure your code functions the way external users expect it to. There's a reason SQLite has an extremely robust test suite even if their code is great. Testing that the internal interfaces / abstractions in your system is less important - which I believe is what you're getting at. Those tests are definitely echoes of the implementations. Often they're for other developers.
- IshKebab 4y agoYou definitely have to write fewer tests in well typed languages like Rust, but you still need some tests! Maybe 1/3 as many as in something like Python, rough guess.