Testing evaluates software behavior to find defects and verify requirements. In Haskell, pure functions make this especially direct: compare a function’s output with its specification without adapters, fake environments, or side-effect setup. section 9.0 section 1.2.3
Unit testing checks small, self-contained code units individually. Integration testing examines component interplay, while system testing checks requirements on the finished system; reliable higher-level tests depend on trustworthy lower-level tests. section 9.1
Property testing improves on manually enumerated examples:
- Express correct behavior as a property relating inputs and outputs. section 9.1
- Generate many random inputs and check the property for each one. section 9.0 section 9.1
- Use QuickCheck, or build a small framework, then tailor generators for special cases and incorporate suites into Stack projects. section 9.0
Example-based versus property-based checks
An example-based test supplies a handcrafted input and expects a predetermined result. Property testing instead checks a stated rule across randomly generated inputs, increasing the chance of exposing forgotten edge cases. section 9.1
Figure 9.1 The testing pyramid
Use the testing pyramid to compare unit, integration, and system testing levels. section 9.1




















































