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

StateMachineTest's apply method should use the current state, not the next state. #488

Open
liarokapisv opened this issue Jul 31, 2024 · 0 comments
Labels
quality-of-life This issue proposes a change that will improve the UX of proptest but isn't necessarily a "feature"

Comments

@liarokapisv
Copy link

liarokapisv commented Jul 31, 2024

Assuming that the model is implemented properly, it can be useful to have access to the model corresponding to the system under test before the transition is applied.

This is useful when the transition result depends on the current state. For example, when modeling an actual state machine, we may have certain side effects that only apply to specific states.

I think the current state should be provided and if needed, the user can apply the transition to the state to get the next one. This is how rapidcheck does it, for instance.

This can be currently emulated by keeping the current state as a field and explicitly passing the next state to the next SUT at the end of apply, but it's pretty cumbersome.

@liarokapisv liarokapisv changed the title StateMachineTest's apply method should use the current state, not the next state. StateMachineTest's apply method should use the current state, not the next state. Jul 31, 2024
@matthew-russo matthew-russo added the quality-of-life This issue proposes a change that will improve the UX of proptest but isn't necessarily a "feature" label Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quality-of-life This issue proposes a change that will improve the UX of proptest but isn't necessarily a "feature"
Projects
None yet
Development

No branches or pull requests

2 participants