▲ | latchkey 4 days ago | ||||||||||||||||||||||
wtf is a hidden edge case? Is that like flying a plane with blinders on? Come on... You write tests to cover edge cases. If you miss one, you write more tests when you come across them. This isn't magic. | |||||||||||||||||||||||
▲ | hnlmorg 4 days ago | parent [-] | ||||||||||||||||||||||
> If you miss one, you write more tests when you come across them. …before such point you have hard to find bugs in your software. And that’s the crux of everyone’s argument against your “just write better code” fallacy ;) > This isn't magic. No it’s not. That’s why people disagree with your assessment that unit tests can catch every type of bug. If unit tests really were that magical then we wouldn’t need for other methods of tests. I mean, do you even know what a unit test is? It’s meant to be self-contained but the problem with multithreaded code is that you can start to introduce side effects that happen outside that functions scope. I’ve got exactly that issue right now calling OS APIs from cgo. Some of those APIs (particularly with SDL) are very thread sensitive and you cannot unit test for that because the problem lies outside that functions scope. So the only way to test for that is with e2e or integration tests instead. | |||||||||||||||||||||||
|