Comment by godelski
16 days ago
I think you have the correct approach. Tests are signals, not proofs.
I do often hear on HN people advocating for Test Driven Development (TDD) but that I think is a different category of error. It encourages people to write to the tests, not to the spec. They'll claim the test is the spec but not understand that the spec can't be written down in full. The spec is the intent, the written spec is an approximation of that, the tests are an approximation of that.
The problem with TDD is it makes it easy to believe that by passing the tests your code is complete and bug free. It's easy to test tests as proofs.
But just because tests aren't proofs doesn't mean they're not useful. They narrow the space in which errors exist. Tests also are a form of communication. It can tell others about your assumptions, again, making the search space for debugging smaller.
Tests are useful, but no one can write tests that are complete.
No comments yet
Contribute on Hacker News ↗