QuickCheck: a lightweight tool for random testing of Haskell programs
ICFP '00 Proceedings of the fifth ACM SIGPLAN international conference on Functional programming
Polytypic data conversion programs
Science of Computer Programming
Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Fast and loose reasoning is morally correct
Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Smallcheck and lazy smallcheck: automatic exhaustive testing for small values
Proceedings of the first ACM SIGPLAN symposium on Haskell
Just do it: simple monadic equational reasoning
Proceedings of the 16th ACM SIGPLAN international conference on Functional programming
Testing polymorphic properties
ESOP'10 Proceedings of the 19th European conference on Programming Languages and Systems
Proceedings of the 15th Symposium on Principles and Practice of Declarative Programming
Hi-index | 0.00 |
The specification of a class in Haskell often starts with stating, in comments, the laws that should be satisfied by methods defined in instances of the class, followed by the type of the methods of the class. This paper develops a framework that supports testing such class laws using QuickCheck. Our framework is a light-weight class law testing framework, which requires a limited amount of work per class law, and per datatype for which the class law is tested. We also show how to test class laws with partially-defined values. Using partially-defined values, we show that the standard lazy and strict implementations of the state monad do not satisfy the expected laws.