This repository was archived by the owner on Jun 18, 2021. It is now read-only.
This repository was archived by the owner on Jun 18, 2021. It is now read-only.
What should mock be used for #236
Closed
Description
I am not sure what should be mock
, last parammeter to StateMachine
be used for and how it is used in a current implementation?
This line is onpar with my understanding https://github.com/advancedtelematic/quickcheck-state-machine/blob/master/test/Echo.hs#L146
Also I can't deduce why mock
would be needed from readme section on hackage:
Sequential property
The sequential property checks if the model is consistent with respect to the semantics. The way this is done is:
generate a list of actions;
starting from the initial model, for each action do the the following:
check that the pre-condition holds;
if so, execute the action using the semantics;
check if the the post-condition holds;
advance the model using the transition function.
If something goes wrong, shrink the initial list of actions and present a minimal counterexample.
Parallel property
The parallel property checks if parallel execution of the semantics can be explained in terms of the sequential model. This is useful for trying to find race conditions -- which normally can be tricky to test for. It works as follows:
generate a list of actions that will act as a sequential prefix for the parallel program (think of this as an initialisation bit that setups up some state);
generate two lists of actions that will act as parallel suffixes;
execute the prefix sequentially;
execute the suffixes in parallel and gather the a trace (or history) of invocations and responses of each action;
try to find a possible sequential interleaving of action invocations and responses that respects the post-conditions.
The last step basically tries to find a linearisation of calls that could have happend on a single thread.
Metadata
Metadata
Assignees
Labels
No labels