Changelog
Source:NEWS.md
mutator 0.3.0
Mutation operators
- New
operatorsargument ofmutate_file()andmutate_package()to select the mutation operators by id or family, e.g.operators = c("default", "seq_idiom", "-bool_flip"). The optionmutator.operatorssets it for a session. The newmutation_operators()lists the operators. - New operators: boundary changes of relational operators (
<to<=),^,%%and%/%swaps, removal of an&&/||operand,break/nextswaps, forced conditions, off-by-one constants, empty strings, and R-specific operators:TRUE/FALSEflips (also in argument defaults),<<-to<-,&&to&,maxtopmax,[[to[,seq_len(n)to1:n, droppingdrop = FALSEand other named arguments, function swaps (any/all,min/max,head/tail, …), removal of wrappers such asrev()orunique(), and removal of error handling (tryCatch(),stop()). The replacement of values by42, which was disabled, is available asvalue_42. - The default set changed, based on a benchmark of the operators on seven CRAN packages (see the README). It adds the boundary,
&&/||operand,break/next,TRUE/FALSE,<<-, named argument, function swap and error handling operators.NAtype swaps (NAtoNA_integer_, …) are no longer in the default set, as most of their mutants are equivalent. Results ofmutate_package()therefore differ from earlier versions. -
# mutator:ignore-startand# mutator:ignore-filecan list operator ids or families, to exclude only those operators. -
mutate_package()reports the mutation score per operator insummary$by_operator, printed withisFullLog = TRUE. - Mutants that cannot change the behaviour of the code are no longer written or tested: those identical to the original code or to another mutant, and those that simple rules show to be equivalent (for example
pastetopaste0with a single argument). A message gives their number per file.
Equivalent mutant detection
- Requests refused for rate limiting (HTTP 429) or by an overloaded gateway (502, 503, 504) are retried with exponential backoff, honouring
Retry-After. Network errors are retried twice, and a request may wait up to 30 minutes for the answer of a reasoning model. - When an answer is cut off by the output token limit, the verdicts of its complete entries are kept and the missing mutants are asked again in smaller batches.
mutator 0.2.2
- The reusable GitHub Actions workflow now installs mutator from CRAN by default, instead of from the tip of the GitHub repository. A new
mutator-sourceinput selectscran(default),r-universe,github, orlocal(mutator is the package under test). When CRAN or r-universe cannot provide the package, the workflow falls back toPRL-PRG/mutatorat the tag given by the newmutator-refinput, which defaults to the release the workflow is versioned with; setmutator-fallback: falseto fail instead. The existingmutator-specinput still accepts a raw pak spec and now overridesmutator-source; it no longer defaults to GitHub.
mutator 0.2.1
CRAN release: 2026-08-02
This release addresses feedback received from CRAN during the review of the initial submission:
- Removed the default output directory from
mutate_file(), so callers must explicitly choose where mutant files are written. - Restored the caller’s working directory immediately with
on.exit()in all package test-runner and coverage code paths that temporarily change it.
It also improves Windows support:
- Mutant package copies now link directories with junctions (
Sys.junction()) rather than symbolic links on Windows, whichunlink()cannot remove; this avoids leftover reparse points and the accompanyingR CMD checkwarnings.
mutator 0.2.0
- Added first-class
tinytestsupport. A package with aninst/tinytestdirectory is now auto-detected and its mutants are run in-process withpkgload::load_all()andtinytest::run_test_dir(), without an install per mutant, including coverage-guided test selection. - Added a
strategyargument tomutate_package()to override test-framework auto-detection. Accepted values are"auto"(the default),"testthat","tinytest","tinytest-installed", and"installed". - Added a
tinytest-installedstrategy that installs each mutant and runstinytest::test_package(). It is a fallback for packages whose in-process load diverges from an installed copy and unlike the generic installed-tests fallback it still supports coverage-guided selection. - Reworked the README and configuration vignette, documenting how the test strategy is selected and when to override it.
- Fixed the
per_filecoverage backend to forward the package’stests/testthat.Rharness arguments (notably anyfilter) totestthat::test_dir(), matching therecord_testsbackend.
mutator 0.1.1
- Fixed coverage-guided baseline runs for packages with native code by compiling native sources before mutant execution.
- Fixed the
record_testscoverage backend so it forwards the selected CRAN mode consistently. - Updated the reusable GitHub Actions workflow to install
imputesrcreffrom its default branch, replacing the removed development-branch reference. - Expanded mutation-system coverage across execution modes and raised mutator’s own test coverage above 90% without adding slow integration tests.