# infection/infection

PHP Mutation Testing library

Repository: https://github.com/infection/infection
Canonical: https://ross.abutalabs.com/products/infection
Homepage: https://infection.github.io
Language: PHP
License: BSD-3-Clause
License Family: permissive
Topics: php, mutation, mutant, test-framework, ast, coverage, infection, testing, mutation-analysis, mutation-testing
Last push: 2026-08-25T14:54:49+00:00

## Health v2 (maintenance only)
Score: 99/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 98, longevity 100
- inputs: {"age_days": 3352, "days_push": 8, "days_rel": 14, "gap_med": 9, "n_releases_24m": 40}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2235, forks 190 (observed 2026-08-28T04:06:29.336241+00:00)

## What it is
Infection is a mutation testing framework for PHP that mutates source code to find gaps in test suites. It computes a Mutation Score Indicator (MSI) and integrates with PHPUnit, Codeception, and PHPSpec, with CI enforcement via --min-msi.

## Use cases
- measure how good my PHP test suite really is
- find untested code paths beyond line coverage
- enforce a minimum mutation score in CI
- mutate only lines changed in a pull request
- run mutation testing with PHPUnit or Codeception
- generate a test quality badge for my README

## When to choose
- you have a PHP project with PHPUnit, PHPSpec, or Codeception tests
- line coverage looks high but you suspect weak assertions
- you want an MSI gate in CI or a quality badge
- you need git-diff-scoped mutation testing for PRs

## When to avoid
- your project is not written in PHP
- your test suite is too slow to run repeatedly
- you only need basic coverage reports, not mutation analysis

## Facets
- artifact type: library
- maturity: active
- function: testing, cli, developer-tools
- domain: testing, developer-tools
- platform: php, cli, cross-platform
- tags: mutation-testing, phpunit, codeception, phpspec, test-quality, msi, ast, code-coverage, php

## Member repositories
- infection/infection (main) score 99

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:29.336241+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:44:19.525892+00:00, confidence not recorded.
  - readme: https://github.com/infection/infection (fetched 2026-08-28T04:06:29.336241+00:00, sha d2e90d38c55d)
  - homepage: https://infection.github.io (fetched 2026-08-29T10:24:50.076104+00:00, sha e9834759d55a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
