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

Make class declarations public to enable save and replay of shrinked command sequences #143

Open
dpolivaev opened this issue Feb 9, 2015 · 3 comments

Comments

@dpolivaev
Copy link

After ScalaCheck generates and executes some command sequences, finds failures and shrinks the sequences to the smallest sequences required to reproduce a bug, it could be helpful to save such distilled sequences which could be used for debugging of SUT and for regression tests. I would like to implement an extension which can capture and replay the findings.

It looks like currently a minor issue stops me from doing it. trait Commands in package org.scalacheck.commands declares private type Commands = List[Command] and private case class Actions(s: State, seqCmds: Commands, parCmds: List[Commands])

Objects of this types are later available in test result communicated to TestCallBack. So the command list could be serialized and replayed.

Therefore I suggest to either make the types public or to create a new public type used in Test.Result.status.args which could be used in implementation of TestCallBack for serialization of the found test sequence.

Regards,
Dimitry Polivaev

@rickynils
Copy link
Contributor

We are slowly moving towards reproducible tests in ScalaCheck by making the generators deterministic. In the end, that should make the stateful tests reproducible too.

@dpolivaev
Copy link
Author

In my eyes one important advantage of scalacheck is its ability to shrink generated test command sequences and so to find smallest possible tests which still find bugs. The goal of this request is to be able to save a shrinked command sequence in a file so that it can be used as a test case for debugging and later as a regression test.

It is not given just by ability to replay the whole sequence of tests just with the same seed. Therefore I would like to ask you to reopen this issue.

Please let me know what you think and also let me see you have read this post.

Regards,
Dimitry Polivaev

@rickynils
Copy link
Contributor

@dpolivaev You are correct, even if the tests are deterministic there is nothing that says the system under test is deterministic. So somehow saving the final (minimized) command sequence would actually be useful. I'll re-open this issue and start thinking about a solution.

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

2 participants