8 Writing tests
This chapter covers
- Writing code and developing with testing in mind
- Unit testing, property testing, and other approaches to testing
- Improving code quality
Every customer is happy to get correct software. It is often claimed that the Haskell type system provides software correctness. Unfortunately, some limitations exist to what the current type system is able to guarantee. That’s why we still need to test our code. Haskell supports many approaches to code correctness assurance, ranging from unit testing and property testing to lightweight formal verification. We don’t have to apply all of them, but it’s a good idea to apply at least some. Once we have tests, it’s much easier to refactor the code or make it run faster.
In ...
Get Haskell in Depth now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.