Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Randomised tests are not reproducible #115

@Timmmm

Description

@Timmmm

With the -r / --randomize flag, riscv-ctg uses python-constraint's MinConflictsSolver. This is not reproducible. It seems like this was noticed at least:

A obvious down-side of using random solvers is the fact that the same test cannot be reproduced again. However, the typical intent of users of CTG would be to generates tests satisfying the cover-points defined in the CGF. Since that is guaranteed by CTG, the reproducibility issue can be set aside.

I guess this was really set aside because unfortunately MinConflictsSolver uses global random and doesn't let you provide a seed. This can be easily worked around by seeding the global random before solving, or by copying & fixing MinConflictsSolver. But I think I will just fix it in that project.

I also noticed some other uses of the global random in riscv-ctg which should not be there: several uses of random.choice in cross_comb.py.

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