[erlang-questions] Proper/EQC parallel statem test question
Wed Dec 5 09:22:06 CET 2012
On 2012-12-04 22:12, Gleb Peregud wrote:
> Hi list!
> Does postcondition of the statem test has to be a pure function? Is it
> OK to do a request to a processe of the tested system from
> postcondition like I do here  ?
If you have a sufficiently complicated system you might have to do a
number of things to validate what you have done is actually correct, so
I think what you are doing is in principle okay.
The trick is that you have make sure that you are fully done with a test
step before you proceed.
To exemplify what you might have to deal with: I had a system where I
had to observe multiple messages in the system to be sure that
everything was okay. For that I spawned a process for each message and
if the message occoured before some reasonable timeout the process
reported true back to a collector process. The collector process checked
all responses and replied back to the test.
That worked. I knew how long it was reasonable to wait and then I could
introduce the synchronisation point needed by - in my case - QuickCheck.
> This becomes a problem for me when running degenerated parallel test
> where commands seems to be run in a single process, while
> postcondition is being checked in another test. Example:
> Sequential part:
> Parallel part:
> Process one: 
> Process two: [
> So essentially it is still a sequential test, since only one of the
> two parallel testers is running any code. But due to postconditions of
> actor_search operation being run in yet another process (probably main
> test process) they are getting mixed up.
This I do not understand - could you elaborate on what is going on?
> P.S. This is an academic project, hence I am using Proper and can't
> test if it behaves differently in full version EQC.
> 1: https://github.com/gleber/dstree/blob/master/test/dstree_statem.erl#L129
> erlang-questions mailing list
More information about the erlang-questions