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

Model based/stateful testing with .Repeat does not test sufficiently different distributions of each operation #69

Open
danwt opened this issue Jul 30, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@danwt
Copy link

danwt commented Jul 30, 2024

Because of this it is necessary to have bogus logic to implement it yourself

@flyingmutant
Copy link
Owner

Can you expand a bit, what kind of distribution do you want to achieve?

@danwt
Copy link
Author

danwt commented Jul 30, 2024

Hi thanks for getting back so quick

So for example, given operations A,B, a program bug may be exposed only with a sequence of operations

AAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAA

or other such 'skewed' distributions

Obviously it's not easy to guess the distribution that would find the bug beforehand, that's the goal of the library in this case.

So I would suppose a naive approach, but one that might be useful in practice, is to have distributions such as

A,B,C
0.33,0.33,0.33
1,0,0
0,1,0
0,0,1
0.5,0.5,0
0.5,0,0.5
0,0.5,0.5
0.99,0.01,0.01
0.01,0.99,0.01
0.01,0.01,0.99
...
etc

I appreciate this is not an easy problem, per say

@flyingmutant flyingmutant added the enhancement New feature or request label Jul 30, 2024
@flyingmutant
Copy link
Owner

Yep, that's definitely something I would like to add/improve. Are you aware of any formalization that can be used as the basis for implementation instead of doing it completely ad-hoc?

The only paper on the subject that I remember right now is this one, but I'd say the method used in it is rather ad-hoc.

@danwt
Copy link
Author

danwt commented Jul 30, 2024

I'm not sure to be honest it's been a while since I was looking into the area. I recall some papers on doing a series of flips on operations. There is also the whole field of model checking to draw from.
A good search term is 'test case diversity'

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

No branches or pull requests

2 participants