logoalt Hacker News

agentultratoday at 8:26 PM1 replyview on HN

Djikstra seemed like he was mostly against testing. But only because he was for proofs. A unit test is a single example. The real way to demonstrate the absence of errors is to prove they aren’t there (vis a vis axioms and assumptions).

But most developers don’t have the mathematical sophistication nor the time.

It’s not that unit testing is useless. Just good to know what their limitations are and to plan your testing strategy accordingly.


Replies

bunderbundertoday at 8:55 PM

You also have the problem of potentially having to re-verify everything by hand for every little change. Maybe fine for the kinds of projects Dijkstra was working on, but less practical in a business setting.

Tools like QuickCheck and Hypothesis are an interesting middle ground, though. I strongly prefer them over standard-issue unit testing for verifying algorithm implementations.

show 1 reply