Hi All,<br>   I am exploring use of quickCheck to define the test-specification for a 3rd party component.<br>   The component is basically an Command/Response type of application.<br><br>   Hence to validate it, I thought that the best way might be to take the following approach(based on the quickCheckM paper)<br>
<br>a. describe the component in a purely functional way.  The functions would take the &quot;AppState&quot;, &quot;Command&quot; as parameters and would return a Response.  Let me call this the &quot;Abstract Application&quot;<br>
    The signature for this would therefore be of the form <br>     abstract_App :: AppState -&gt; Command -&gt; Response<br><br>b. define an agent (Let me call it as Real_App) that  that would <br>    (i) take a initial State,  &quot;Command&quot; and send it to the &quot;Application Under test&quot; using some IPC mechanisms(probably socket or FIFO files)<br>
    (ii) parse the received response and send it back as &quot;Response&quot;.  As a result the the API for the agent would be of the form<br>   real_APP :: AppState -&gt; Command -&gt; IO Response<br><br>c. write a quick-check specification that would send a bunch of commands to the &quot;Abstract Application&quot; and check for equivalence with the value returned by the &quot;real_App&quot;<br>
<br>However, being a newbie, I am not able to understand how I can extract the &quot;Response&quot; part from the IO Response.<br><br>I want something as follows<br>prop_App state_x command_y = (abstract_App state_x command_y ) == (real_App state_x command_y)<br>
<br><br>The issue here is that since the reall_App would return a &quot;IO Response&quot; and not &quot;Response&quot; I cannot really compare the abstract_App with the real_App.<br><br>Any thought on how I can extract the value from the &quot;IO Response&quot; so that I can compare the the two implementations for equvivalence.<br>
<br>FYI, I have gone through the various quickcheck related docs like<br><a href="http://www.cs.chalmers.se/~rjmh/QuickCheck/">http://www.cs.chalmers.se/~rjmh/QuickCheck/</a><br><a href="http://www.haskell.org/haskellwiki/QuickCheck_as_a_test_set_generator">http://www.haskell.org/haskellwiki/QuickCheck_as_a_test_set_generator</a><br>
<br><br>Thanks<br>- Srikanth<br>