<div dir="ltr"><div>Hello,</div><div><br></div><div>I have written a Haskell module that contains functions that operate on some state. Let's say that the code looks like this (the actual functions may return an actual result instead of `()`, but this is irrelevant to the question):</div><div><br></div><div>    data StateContext = StateContext {</div><div>      -- some records</div><div>    }</div><div>    </div><div>    handleEventA :: EventA -> State StateContext ()</div><div>    handleEventB :: EventB -> State StateContext ()</div><div>    handleEventC :: EventC -> State StateContext ()</div><div><br></div><div>As you can imagine the behavior of each function depends on the current state. For example `handleEventA >> handleEventB` will not produce the same result as `handleEventB >> handleEventA`. So I have several HUnit tests that verify the behavior of each function at several states.</div><div><br></div><div>But now I would like to write more tests, that exercise all functions at all possible states (the number of states is finite). Writing them with HUnit would be quite labor-itensive, so I thought that using QuickCheck might be helpful in that case (I have only used it before for trivial functions). </div><div><br></div><div>But I cannot see which properties should I test, or what kind of data should the test generate. I suspect that the test should generate random sequence of events (e.g. `handleEventB >> handleEventC >> handleEventA` etc), but I cannot see what properties should be satisfied.</div><div><br></div><div>Thanks</div><div><br></div></div>