Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> [Tests] only catch certain classes of errors. But, when you have them, you have the assurance that the code behaves as it does in the test when the same conditions occur in production.

The trouble is, tests typically don't guarantee to catch an entire class of errors. Rather, each test guarantees to catch one specific case, and when you write your tests you try to cover a useful number of representative cases.

This is not to say that executable tests don't have their place, of course, but the plural of "unit test" is not "proof". On the other hand, if you can verify a certain property totally via your type system then executable tests for that property are unnecessary.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: