Testing properties of generic functions
Publication date
2006
Authors
Jansson, P.
Jeuring, J.T.
Cabenda, L.
Engels, G.
Kleerekoper, J.
Mak, S.
Overeem, M.
Visser, Kees
Editors
Advisors
Supervisors
DOI
Document Type
Report
Metadata
Show full item recordCollections
License
Abstract
Software testing is an important part of the software devel-
opment process. Testing comes in many flavours: unit testing, property
testing, regression testing, contract checking, etc. QuickCheck is proba-
bly one of the most advanced tools for testing properties of functional
programs. It supports the de¯nition of properties and random test-data
generators in Haskell, and checks that a property passes the test cases.
A datatype-generic function is parametrised by a type. Examples of
generic functions are equality tests, maps and pretty printers. A generic
function can be seen as a template algorithm that can be instantiated
with (the structure of) a data type. Generic functions satisfy generic
properties. This paper discusses testing properties of generic functions.
It shows how generic properties can be formulated, and how QuickCheck
can be used to test generic properties. Furthermore, it shows how to
automatically generate QuickCheck generators using Generic Haskell.