[Haskell-cafe] QuickCheck Questions

Yusaku Hashimoto nonowarn at gmail.com
Sun Sep 27 15:19:24 EDT 2009


Hello, I recently worked with QuickCheck for a while, But I still
can't handle it well, And a few questions  come to my mind.

1. How to find properties

In QuickCheck examples on the codes or the papers, they find good
properties easily. How did they find these properties? What property
can make us believed its implementation is collect?

2. Property driven developments

But finally, I could find some patterns of the properties. For
example, occasionally, their shape is like

  unF . f == id
  or
  unF . f == Just

I thought it could be applied to writing parser, and lead me to
"Property Driven Developments." I tried writing S-expression parser in
this way. First, I defined my property as

    parseSexpr . prettySexpr == Just

where parseSexpr :: String -> Maybe Sexpr, prettySexpr :: Sexpr ->
String. As you see, I should write printer before parser. Fortunately
writing such printer for S-expr is easy, but I don't know if what I
did is right.

Do you think I wasted times? Have you ever tried PDD? And has it
worked? If you have experience with TDD, how do you think about PDD?

If you have any answers in any questions above, please tell me them.
Thanks in advance.

Cheers
-nwn


More information about the Haskell-Cafe mailing list