Skip to content

independence of test cases vs reproducibility #26

@piccolbo

Description

@piccolbo

The reproducibility feature may have some undesirable statistical properties. The idea is that to estimate the probability of bugs under the test case distribution, one needs independence of the code from the test cases. In statistical parlance, to estimate generalization performance (bug freeness) of a model (function) one needs the model to be picked before the test set is chosen or without access to it. If we debug and modify a function based on pseudo-random test cases we may end up with an implementation that's tailored for the test cases. That has to deal with how the test function is seeding the RNG. Right now, it uses a minhash based on tokens of the deparsed-assertion. That is, the seed changes only for substantial changes in the assertion. Any change in the function to implement would not affect the seeding. An example is the following

ff = function(x) x %in% c( 0,  4,  6, 24, 29 ,50, 56, 86)
test(forall(x = rsize(size = c(max  = 100)), ff(x)))

What exactly the specs are for ff is not important, but its implementation is based on running the test, seeing where it fails and collecting the generated values. One would be tempted to conclude, assuming that the distribution implemented by rsize is the correct distribution, that the probability of a bug is fairly low, see binom.test(0, 100) (in the sense that we have a confidence interval containing only low probabilities) but the conclusion would be completely wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions