2 ms·
The truth that a lot of people don't want to hear is that tests are insufficient to prove your code is bug free When saying these words aloud (or even on HN) m
by godelski 1y ago
The truth that a lot of people don't want to hear is that tests are insufficient to prove your code is bug free
When saying these words aloud (or even on HN) many will reinterpret them as "tests are worthless". It's hard to reorient to "tests are incomplete". I'm not sure why this is such a difficult concept to understand. Unless you're omniscient, how can they be complete?
People need to understand, you cannot measure anything directly. You are always doing so by proxy. If you do not know the limits of your proxy then you're only allowing yourself to be blind to foreseeable problems.
So, tests are hints, not proofs. They prove correctness in narrow areas, but not completely. Worse, you cannot test unknown unknowns. Which, as you suggest, is why dog fooding is such an important part of the development process. You aren't just a developer, you need to be a user and an adversary. You should try to see your programs from as many perspectives as possible. This too won't get you to full coverage, but it'll get you a lot further than just tests and it'll help you find what tests need to be created.
If you're just doing TDD, you're just applying Goodhart's Law