Testing Properties of Generic Functions

  • Patrik Jansson
  • Johan Jeuring
  • Laurence Cabenda
  • Gerbo Engels
  • Jacob Kleerekoper
  • Sander Mak
  • Michiel Overeem
  • Kees Visser
Conference paper

DOI: 10.1007/978-3-540-74130-5_13

Part of the Lecture Notes in Computer Science book series (LNCS, volume 4449)
Cite this paper as:
Jansson P. et al. (2007) Testing Properties of Generic Functions. In: Horváth Z., Zsók V., Butterfield A. (eds) Implementation and Application of Functional Languages. IFL 2006. Lecture Notes in Computer Science, vol 4449. Springer, Berlin, Heidelberg

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 definition of properties and test-data generators, and they check if a monomorphic property is satisfied by the test cases. Generic functions satisfy generic properties and this paper discusses specifying and testing such properties. It shows how generic properties and generators can be expressed, and explains three bugs we found and corrected in the Generic Haskell library.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2007

Authors and Affiliations

  • Patrik Jansson
    • 1
  • Johan Jeuring
    • 2
  • Laurence Cabenda
    • 1
  • Gerbo Engels
    • 3
  • Jacob Kleerekoper
    • 3
  • Sander Mak
    • 3
  • Michiel Overeem
    • 3
  • Kees Visser
    • 3
  1. 1.CSE, Chalmers University of TechnologySweden
  2. 2.ICS, Utrecht UniversityThe Netherlands
  3. 3.Students of the Utrecht University Generic Programming class 

Personalised recommendations