Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stateful testing: Compare SystemUnderTest to State? #25

Closed
andrewjstone opened this issue Dec 26, 2017 · 1 comment
Closed

Stateful testing: Compare SystemUnderTest to State? #25

andrewjstone opened this issue Dec 26, 2017 · 1 comment

Comments

@andrewjstone
Copy link

Hi,

I really like gopter so far. Thanks for providing such a useful library. I've just run into something unexpected with stateful testing though.

What I want is after each operation to not only compare the Result of the SystemUnderTest command with the model state (State) as in Postcondition, but also to ensure that the internal state of the SystemUnderTest is logically equivalent to the model state. I tried including a pointer to the SystemUnderTest in State so I could just perform this check in Postcondition, but it appears that by the time Postcondition runs, the pointer is pointing to a different value than what was initialized and returned from NewSystemUnderTest.

The rationale for this feature is to be able to test mutable methods on types that don't return values. So far I think the only workaround is to provide some introspection methods that we add as commands so we can then run and compare the output to the model state.

I was wondering if you could provide this capability, via another callback like invariant/1 in eqc_statem, or if there is a specific reason you think it should not be included. And yes, effort is a fine justification :) Thanks!

@andrewjstone
Copy link
Author

andrewjstone commented Dec 26, 2017

It looks like I can just return the SystemUnderTest as part of Result when Run is called. That actually makes more sense than what I was originally trying to do. Sorry for the bother.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant