A PHP mutation testing framework that evaluates test suite quality by injecting faults into source code.
Infection is a mutation testing framework for PHP that evaluates test suite quality by automatically injecting faults into source code. It helps developers identify weak tests by checking whether existing tests can detect these artificial bugs, providing a more meaningful metric than traditional code coverage.
PHP developers and teams who want to improve their test suite quality, particularly those using PHPUnit, Pest, or similar testing frameworks in professional or open-source projects.
Infection provides the most accurate assessment of test effectiveness through mutation testing, with zero-configuration setup for popular PHP testing frameworks and performance optimizations that make it practical for real-world projects.
PHP Mutation Testing library
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Infection works out-of-the-box with popular PHP testing frameworks like PHPUnit and Pest, as stated in the README, minimizing setup overhead.
It uses parallel processing and caching to speed up mutation analysis, making it practical for real-world projects despite the inherent slowness of mutation testing.
Supports custom mutators, allowing teams to tailor fault injection to specific code patterns, enhancing flexibility beyond built-in options.
Provides detailed Mutation Score Indicator (MSI) reports that identify weak tests, offering concrete insights beyond traditional code coverage.
Mutation testing is inherently resource-intensive; even with optimizations, Infection can drastically increase test suite execution time, impacting CI/CD speed.
Understanding mutation scores and distinguishing meaningful failures from noise requires expertise, which can be a barrier for less experienced teams.
As a PHP-specific tool, Infection doesn't support other languages, unlike multi-language mutation frameworks, limiting its use in polyglot environments.