with Herbert Kuchen

  • ICFP ‘08: Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming © ACM Press
  • pdf
  • slides
  • bib

We propose a novel notion of data-flow coverage for testing declarative programs. Moreover, we extend an automatic test-case generator such that it can achieve data-flow coverage. The coverage information is obtained by instrumenting a program such that it collects coverage information during its execution. Finally, we show the benefits of data-flow based testing for a couple of example applications.


We realized belatedly, that some of our experiments have been distorted by a space-fault in Hugs, which we have not been aware of, that causes stack build-up in programs that use exceptions, as Lazy SmallCheck does. We have repeated our experiments using GHCi and found that Lazy SmallCheck is able to find almost all bugs within a few seconds, an exception being the erroneous Kruskal-Algorithm found in Algorithms: A Functional Programming Approach. Here Lazy SmallCheck finds the first counterexample after several minutes (but much faster if parallel conjunction is used to define the precondition of the property). Only in the train ticket example, LazySmallCheck is not able to find the bug.