LinuxCommandLibrary

infection

PHP mutation testing framework

TLDR

Run mutation testing

$ infection
copy
Run with specific threads
$ infection --threads=[4]
copy
Target specific files
$ infection --filter=[src/Service/]
copy
Set minimum score
$ infection --min-msi=[70]
copy
Show mutations
$ infection --show-mutations
copy
Output to file
$ infection --log-verbosity=all --logger-text=[infection.log]
copy

SYNOPSIS

infection [options]

DESCRIPTION

infection is a PHP mutation testing framework. It modifies code to test the effectiveness of your test suite.
The tool creates mutants (modified code) and runs tests against them. Surviving mutants indicate weak test coverage.

PARAMETERS

--threads N

Parallel execution threads.
--filter PATH
Filter source files to mutate.
--min-msi N
Minimum Mutation Score Indicator.
--min-covered-msi N
Minimum covered code MSI.
--show-mutations
Display mutation details.
--mutators LIST
Specific mutators to use.
--help
Display help information.

CAVEATS

PHP-only. Requires PHPUnit or Codeception. Resource intensive on large codebases.

HISTORY

infection was created as a mutation testing tool for PHP, inspired by similar tools in other languages like Stryker.

SEE ALSO

phpunit(1), phpspec(1), pest(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community