This chapter covers:
- Writing code and development process with testing in mind
- Unit-testing, property-testing and other approaches to testing
- Improving code quality
Every customer is happy to get a correct and performant software. It is often claimed that Haskell type system provides software correctness. Unfortunately, there are some limitations 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 quality 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 a correct code (or at least the one we tried to make right), it’s time to make it run fast. To do that, we need to realize where is a bottleneck. Thus we need to explore code behavior and find out its weaknesses. Once we know a reason for slow performance, we should fix it by applying one of the performance tuning techniques.
In this chapter, I’ll present the process of quality assurance with an example of IP addresses processing built from scratch. We’ll continue working with this example in the next chapter, to explore code behavior and tune performance.