CPL - Chalmers Publication Library
| Utbildning | Forskning | Styrkeområden | Om Chalmers | In English In English Ej inloggad.

Testing Properties of Generic Functions

Patrik Jansson (Institutionen för data- och informationsteknik (Chalmers) ; Institutionen för data- och informationsteknik, Datavetenskap, Programmeringslogik (Chalmers)) ; Johan Jeuring
: Utrecht University, 2006. - 20 s.
[Rapport]

Software testing is an important part of the software development process. Testing comes in many flavours: unit testing, property testing, regression testing, contract checking, etc. QuickCheck is probably one of the most advanced tools for testing properties of functional programs. It supports the definition 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.

Nyckelord: Haskell, Random Testing, Generic Programming


Technical Report number UU-CS-2006-043.



Denna post skapades 2007-02-25. Senast ändrad 2014-09-02.
CPL Pubid: 26471