[erlang-questions] PropEr and the symbolic variables
Joseph Wayne Norton
norton@REDACTED
Tue Sep 17 19:01:40 CEST 2013
Aaron -
Here is a demonstration quickcheck statem test for a subset of the ets API - https://github.com/norton/qc/blob/master/test/demo/qc_statem_ets.erl
The example is a demonstration of a wrapper over QuickCheck. This wrapper helps automate some common features and use cases for statem-style tests. Fortunately, the callback API is almost nearly the same as the QuickCheck callback API and the PropEr callback API.
This example might be of help to you.
Joe N.
On 2013/09/18, at 1:10, Aaron France <aaron.l.france@REDACTED> wrote:
> Hi all,
>
> I'm creating a statem for a stateful system and am trying to model the various API calls.
>
> Essentially the system is a PUT/DELETE rest service, you can PUT data which is forevermore available via a further GET call and you can also DELETE said data and subsequent GETs will fail.
>
> This works well, mostly. However, I am not able to satisfactorily maintain what the state of the system is due to receiving symbolic variables in my next state function.
>
> Basically I am recording the state as:
>
> state{ dict() }
>
> and the dict contains:
>
> { username => boolean() }. Where the boolean represents whether that user has data which is in the system.
>
> The problem comes from the fact that my API calls return a status code for how the API call succeeded. Imagine deleting an already deleted piece of data, it would return e.g. a 404 instead of a 204. I model the state accordingly.
>
> When I receive the `Res` argument to my next_state/3 function, it is only sometimes a concrete value which I need. However, I need to change the state conditionally according to what that `Res` value is.
>
> Any ideas?
>
> Aaron
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
More information about the erlang-questions
mailing list