3 ms·
> It's just extremely satisfying to have almost complete confidence that the code will work in production on the first try. I agree that TDD has enormous benef
by sah2ed 6y ago
> It's just extremely satisfying to have almost complete confidence that the code will work in production on the first try.
I agree that TDD has enormous benefits when used with discipline, but remember to temper your expectations as to the actual purpose of tests. The fact that your tests pass doesn’t mean your app is bug free—it is only free of the bugs you were able to test for.
There’s a concise but somewhat counterintuitive quote from Dijkstra that summarizes what tests help you uncover:
”Program testing can be used to show the presence of bugs, but never to show their absence!”
https://en.wikiquote.org/wiki/Edsger_W._Dijkstra#1970s https://en.wikiquote.org/wiki/Edsger_W._Dijkstra#1970s
- l0b0 6y agoThis isn't aimed at you personally, but I find it tedious how this is pointed out every time testing comes up. It is just not relevant, because I've never claimed that TDDed code is bug free, and I've never seen anyone else claim that. It would be ludicrous. Most of the time it is used as some sort of "proof" that TDD or even testing in general is useless, because if it doesn't guarantee bug-free code there's no way it adds any value.