App-Test-Generator
view release on metacpan or search on metacpan
bin/test-generator-mutate view on Meta::CPAN
=item *
If the tests pass, the mutant is considered I<survived>.
=back
A mutation score is then calculated:
(killed / total) * 100
Mutation testing measures the effectiveness of a test suite. A higher
mutation score indicates that the tests are better at detecting behavioral
changes in the code.
=head1 OPTIONS
=head2 --lib <dir>
Directory containing Perl modules to mutate.
Defaults to C<lib>.
=head2 --file <file>
Mutate a single file instead of scanning the entire C<--lib> directory.
=head2 --tests <dir>
Directory containing test files.
Defaults to C<t>.
=head2 --changed_only
Only mutate files that were changed in the most recent commit, as
determined by C<git diff --name-only HEAD~1 HEAD>. Files not changed
in the current commit retain their mutation results from the previous
dashboard run. This significantly reduces CI runtime while preserving
accuracy for the files that actually changed.
=head2 --exclude <path>
Exclude files matching the given path fragment from mutation testing.
May be specified multiple times. For example:
--exclude lib/Devel --exclude lib/App/Test/Generator/Sample
=head2 --base_sha <sha>
The git commit SHA to use as the base when computing which files have
changed under C<--changed_only>. Defaults to C<HEAD~1>.
Use this when automated commits (such as coverage snapshots or generated
test stubs) have landed on top of your last code commit, causing
C<HEAD~1> to point to an automated commit rather than a real change.
Typically set by the CI workflow using the output of C<git log> filtered
to exclude automated commits.
=head2 --min-score <int>
Minimum acceptable mutation score (percentage).
If the final score is below this value, the program exits with a
non-zero status.
=head2 --json <file>
Write mutation results to the specified JSON file.
The output structure:
{
score => "85.32",
total => 120,
killed => 102,
survived => [ ... mutant IDs ... ]
}
=head2 --cover_json <file>
The location of the file generated by C<cover -report json>.
That file is used to generate an approximation for an LCSAJ table.
=head2 --fail-fast
(Reserved for future use.)
=head2 --mutation_level <full|fast>
Setting to C<fast> removes redundant mutations and dedups mutations before running.
The default is C<full>.
=head2 --timeout <seconds>
(Reserved for future use.)
=head2 --verbose
Print progress information.
=head2 --quiet
Suppress final summary output.
=head1 EXIT CODES
=over 4
=item = 0
Success and mutation score meets minimum threshold.
=item = 1
Mutation score below C<--min-score>.
=item = 2
Baseline test suite failed before mutation testing began.
=item = 3
( run in 0.578 second using v1.01-cache-2.11-cpan-7fcb06a456a )