hubFS: THE place for F#

. . . are you on The Hub?
Welcome to hubFS: THE place for F# Sign in | Join | Help
in Search

FsCheck 0.1: Random testing for F#

Last post 08-08-2008, 14:32 by Kurt. 3 replies.
Sort Posts: Previous Next
  •  05-11-2008, 10:47 5890

    FsCheck 0.1: Random testing for F#

    Hi all,

    FsCheck is a tool for random testing of F# programs. It's a port of
    Haskell's QuickCheck. Please find more information on my blog:

    http://fortysix-and-two.blogspot.com/2008/05/fscheck-random-testing-for-f.html

    Enjoy, and please do send me comments (good or bad), improvements and patches.

    Kurt
    http://fortysix-and-two.blogspot.com/
  •  05-13-2008, 15:22 5905 in reply to 5890

    Re: FsCheck 0.1: Random testing for F#

    I notice that fscheck's conditional expressions aren't quite lazy enough. For example, say I have

    let prop_foo = forAll (Gen.Int) (fun a -> false ==> prop (printf "foo\n"; true))

    quickCheck prop_foo will print foo 100 times before saying that the arguments were exhausted. But if the left-hand side of ==> is false, the right-hand side shouldn't be evaluated at all!

    Haskell gets around this problem by its implicit laziness (to say nothing of its referential transparency). QCheck for sml requires the arguments of ==> to be functions, and achieves its laziness that way.

    Actually QCheck for sml has a slightly different design from fscheck, but the authors seem to have gotten around some of the limitations you've run into. Have you looked at it?

    galen

  •  07-09-2008, 0:02 6332 in reply to 5890

    Re: FsCheck 0.1: Random testing for F#

    Since I cant find an email address for you just wanted to let it be known that I have an implementation of that random number generator you linked to in your code and on your blog. I still have to hammer out some bugs but it pretty much works well. Probably should build a computational expression using the State Monad to make it a bit more beautiful but for now I am happy with what I have written and wouldn't mind sharing it with you, or anyone.
  •  08-08-2008, 14:32 6551 in reply to 6332

    Re: FsCheck 0.1: Random testing for F#

    Hi Birchoff,

    Sorry for the late reply, I've been a bit inactive with respect to F# lately.

    But if you're reading this I'd still be interested, although I already ported the Haskell libs random number generator.

    You can reach me at kurt.schelfthout at gmail.com

    cheers!

    Kurt
    http://fortysix-and-two.blogspot.com/
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems