QuickCheck: A lightweight tool for random testing of Haskell programs

被引:516
作者
Claessen, K [1 ]
Hughes, J [1 ]
机构
[1] Chalmers Univ Technol, S-41296 Gothenburg, Sweden
关键词
D O I
10.1145/357766.351266
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
QuickCheck is a tool which aids the Haskell programmer in formulating and testing properties of programs. Properties are described as Haskell functions, and can be automatically tested on random input, but it is also possible to define custom test data generators. We present a number of case studies, in whic hthe tool w as successfully used, and also point out some pitfalls to avoid. Random testing is especially suitable for functional programs because properties can be stated at a fine grain. When a function is built from separately tested components, then random testing suffices to obtain good coverage of the definition under test.
引用
收藏
页码:268 / 279
页数:12
相关论文
共 20 条
[1]  
ANTOY S, 1992, IRV SOFTW S MARCH
[2]  
Backhouse R., 1999, LECT NOTES COMPUTER, V1608/1999
[3]  
BJESSE P, 1998, INT C FUNCT PROGR
[4]  
BLUM M, 1990, PROCEEDINGS OF THE TWENTY SECOND ANNUAL ACM SYMPOSIUM ON THEORY OF COMPUTING, P73, DOI 10.1145/100216.100225
[5]  
Blum M., 1989, Proceedings of the Twenty First Annual ACM Symposium on Theory of Computing, P86, DOI 10.1145/73007.73015
[6]   COMPILER TESTING USING A SENTENCE GENERATOR [J].
CELENTANO, A ;
CRESPIREGHIZZI, S ;
DELLAVIGNA, P ;
GHEZZI, C ;
GRANATA, G ;
SAVORETTI, F .
SOFTWARE-PRACTICE & EXPERIENCE, 1980, 10 (11) :897-918
[7]  
Claessen Koen, 1999, AS COMP SCI C
[8]   A COMPUTING PROCEDURE FOR QUANTIFICATION THEORY [J].
DAVIS, M ;
PUTNAM, H .
JOURNAL OF THE ACM, 1960, 7 (03) :201-215
[9]   AN EVALUATION OF RANDOM TESTING [J].
DURAN, JW ;
NTAFOS, SC .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 1984, 10 (04) :438-444
[10]  
GANNON J, 1981, T PROG LANG SYSTEMS, P211