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 "AppState", "Command" as parameters and would return a Response. Let me call this the "Abstract Application"<br>
The signature for this would therefore be of the form <br> abstract_App :: AppState -> Command -> Response<br><br>b. define an agent (Let me call it as Real_App) that that would <br> (i) take a initial State, "Command" and send it to the "Application Under test" using some IPC mechanisms(probably socket or FIFO files)<br>
(ii) parse the received response and send it back as "Response". As a result the the API for the agent would be of the form<br> real_APP :: AppState -> Command -> IO Response<br><br>c. write a quick-check specification that would send a bunch of commands to the "Abstract Application" and check for equivalence with the value returned by the "real_App"<br>
<br>However, being a newbie, I am not able to understand how I can extract the "Response" 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 "IO Response" and not "Response" I cannot really compare the abstract_App with the real_App.<br><br>Any thought on how I can extract the value from the "IO Response" 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>