4 ms·
Just an idea: this or something similar could be utilized to generate test vectors, for property based testing [0]. Also for model-based testing, if you consid
by olvy0 4y ago
Just an idea: this or something similar could be utilized to generate test vectors, for property based testing [0]. Also for model-based testing, if you consider the model to be a vector of actions [1]
Currently, AFAIK, property based testing relies on mostly random generation of input vectors. It's possible to "shape" those vectors into other data structures such as trees [2] and it's the way it's usually done, but it's difficult and error-prone for more complex inputs.
There's also the option to filter each vector before running, or, after running, by performing the shrinking algorithm to produce the minimal input vector that reproduces the problem.
When I tried using property based testing for my use-case, as a model-based testing, I had to write code to filter most of the random test vectors since they weren't relevant, they didn't make sense.
So it might be possible to guide the generation of the input vectors so they'll be less random, and save time during run.
[0] https://typeable.io/blog/2021-08-09-pbt https://typeable.io/blog/2021-08-09-pbt
[1] https://fscheck.github.io/FsCheck/StatefulTesting.html https://fscheck.github.io/FsCheck/StatefulTesting.html
[2] https://www.stackbuilders.com/blog/a-quickcheck-tutorial-generators/ https://www.stackbuilders.com/blog/a-quickcheck-tutorial-gen...