3 ms·
Testing attempts to pin down specific use cases to ensure that they meet certain requirements. Alas they only single out one case at a time - there could be a w
by bjz_ 9y ago
Testing attempts to pin down specific use cases to ensure that they meet certain requirements. Alas they only single out one case at a time - there could be a wide range of possible failure conditions you forgot to test. Types allow you to cut down the space of possibilities to a more manageable level to ensure that your testing can be more targeted.
To see this pushed to the extreme, and to have a glimpse of the future, check out Edwin Brady's book "Type Driven Development with Idris": https://www.manning.com/books/type-driven-development-with-idris https://www.manning.com/books/type-driven-development-with-i... - I don't expect this style of programming to become the norm until at least another several years, but it essentially allows you to push all behavioral specifications into the types, rendering most unit testing tests obsolete. Of course I would still have smoke and integration tests to for sanity checking sake.