Testing properties of generic functions

Publication date

2007

Authors

Jansson, P.
Jeuring, J.T.
Cabenda, L.
Engels, G.
Kleerekoper, J.
Mak, S.
Overeem, M.
Visser, Kees

Editors

Advisors

Supervisors

DOI

Document Type

Preprint
Open Access logo

License

Abstract

A datatype-generic function is a family of functions indexed by (the structure of) a type. Examples include equality tests, maps and pretty printers. Property based testing tools like QuickCheck and Gast support the de¯nition of properties and test-data generators, and they check if a monomorphic property is satis¯ed by the test cases. Generic functions satisfy generic properties and this paper discusses specifying and testing such properties. It shows how generic properties and gener- ators can be expressed, and explains three bugs we found and corrected in the Generic Haskell library

Keywords

Citation