View source: R/mutator-presets.R
| condition_mutations | R Documentation |
Returns a ready-made list of negate_condition() and
remove_condition_negation() mutators covering both directions of condition
logic: wrapping a plain condition in !(...) and stripping ! from an
already-negated condition.
condition_mutations()
Use on any file with non-trivial if/while conditions. Surviving mutants
mean the branch outcome was never tested with inputs that cross the boundary —
adding a test where the condition flips from TRUE to FALSE kills them.
A list of mutators.
vignette("mutators", package = "muttest") for the full mutator table.
vignette("interpreting-results", package = "muttest") for how to
diagnose survivors and fix the underlying test weakness.
condition_mutations()
## Not run:
plan <- muttest_plan(
source_files = "R/validation.R",
mutators = condition_mutations()
)
muttest(plan, "tests/testthat")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.