mutation tests: make coverage gradual #2057
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here is my proposal for making the mutation tests coverage increase over time while still being practical.
We have 2 testing modes that are run in parallel in CI:
DIFF_COVERAGE. This mode verifies mutations with
test_xx.py
(all of them) on the intersection between its code coverage and the current git diff. This mode is very powerful since it will cover basically all the files if they are changed and will still run super fast.SAFETY_ONLY. This mode verifies mutations on
safety_xx.h
withtest_xx.py
if safety_xx.h is inMUTATION_SAFETY_FILES
. Overtime, the goal is to add all the safety modes in that list. We can split those nicely, add them one by one and even put them on bounties.Regardless of the testing mode, we are using all the ops in the
MUTATION_OPS
list to mutate the code. Overtime, the goal is to add most ops listed here in that list.In the end, we can increase coverage in 3 ways: add files to
MUTATION_SAFETY_FILES
, add ops toMUTATION_OPS
and add a third testing mode for other files we want to always check.