3 ms·
I really like the idea of QuickCheck. Presumably it is -best- used in conjunction with unit testing. It seems to me though that it would be suitable mainly for
by shogunmike 15y ago
I really like the idea of QuickCheck. Presumably it is -best- used in conjunction with unit testing. It seems to me though that it would be suitable mainly for numeric type code, given the random nature of the inputs?
- pja 15y agoRemember that Haskell datatypes are very rich. QuickCheck will generate random instances of any datatype you define. Because Haskell datatypes are so expressive,. t's normal for Haskell programmers to define complex types for their functions to process. Hence you can easily get good coverage of any idiomatic Haskell code with QuickCheck. If you're working in a datatype poor language, or simply one where the syntax makes defining complex datatypes painful then you're much more likely to pass around datatypes which are in implicitly defined. In this case you'll have to write a QuickCheck function to generate suitable instances in order to test your code. (This is also true for Haskell: there are often a few functions where you have to explain to QuickCheck how to generate appropriate test cases.)