▲ | latchkey 4 days ago | |||||||||||||||||||||||||
> The parent stated that some issues only occur under production load and a unit test will not catch it. I can't think of a single production problem that can't be replicated with a unit test. If you're seeing a problem in production, you need to fix it. How do you fix it? You write a test that replicates the problem and then fix the code, which fixes the test. | ||||||||||||||||||||||||||
▲ | zaptheimpaler 4 days ago | parent | next [-] | |||||||||||||||||||||||||
> If you write comprehensive unit tests, it is not easy to have bugs in golang. First you claimed before that unit tests will catch your subtle concurrency bugs before they happen, and that's just not often the case. They are subtle, might involve many systems and weird edge cases and often don't get caught BEFORE they happen. Of course anyone can write a test to replicate the problem after seeing it in production and spending hours/days debugging it. More importantly, "Write comprehensive tests" is technically a strategy to avoid any bug ever. You can tell C programmers not to segfault by writing comprehensive tests but that doesn't negate the point that the language makes it easy to write segfaults. "Write more tests" is not a rebuttal to saying C makes some classes of errors easy to write. Writing comprehensive tests often takes a lot of time, is often not prioritized by companies, and is especially hard with distributed systems, concurrency, mocks and complex applications. If we just said "git gud noob" in the face of error prone and difficult abstractions, we might as well all be using assembly. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | mplewis 3 days ago | parent | prev [-] | |||||||||||||||||||||||||
Then you have not worked on complicated systems. | ||||||||||||||||||||||||||
|