mutmut
mutmut.readthedocs.io
What it is
mutmut is a free, open-source mutation testing system for Python. It makes small code changes called mutants so developers can check whether tests detect them. Its listed operators increment integer literals by one, change < to <=, and swap break and continue. The project supports pytest and remembers completed work for incremental runs, selecting tests to run for each mutant. An interactive terminal interface lets users browse mutants, write one to disk, and rerun individual cases after adding tests. Runs are described as parallel; configured coverage.py can restrict mutations to covered lines. The documentation also supports filtering with mypy or pyrefly, but not pyright or ty. For CI/CD, mutmut can export statistics and generate mutation-score badge JSON for a Shields endpoint. Configuration in setup.cfg or pyproject.toml can specify source paths and pytest selection arguments. It requires Python 3.10 or later and a system with fork support, so Windows users need WSL. Version 3 and later mutate code inside functions; version 2 uses a different model for code outside functions. The package is licensed under BSD-3-Clause.
Spec sheet
- Purpose
- mutmut is a mutation testing system for Python focused on ease of use.Read 8 Oct 2026 · mutmut.readthedocs.io
- License
- The package is distributed under the BSD-3-Clause license.Read 8 Oct 2026 · pypi.org
- Applying mutants
- Users can write a mutant to disk from the browse interface or with the mutmut apply command.Read 7 Oct 2026 · mutmut.readthedocs.io
- CI output
- It can export CI statistics and create mutation score badge data for a Shields endpoint.Read 8 Oct 2026 · mutmut.readthedocs.io
- Configuration
- Configuration is supported in setup.cfg or pyproject.toml, including source paths and pytest test selection arguments.Read 8 Oct 2026 · mutmut.readthedocs.io
- Coverage and type checking
- Optional filters can use coverage.py to select covered lines and mypy or pyrefly to filter invalid mutants.Read 8 Oct 2026 · mutmut.readthedocs.io
- Coverage integration
- mutmut can use coverage.py to filter mutations to covered lines when configured.Read 7 Oct 2026 · mutmut.readthedocs.io
- Distribution
- The PyPI listing shows mutmut version 3.8.0, released September 12, 2026.Read 7 Oct 2026 · pypi.org
- Incremental runs
- It remembers completed work so mutation testing can continue incrementally.Read 8 Oct 2026 · mutmut.readthedocs.io
- Interface
- It provides an interactive terminal based interface for browsing mutants.Read 8 Oct 2026 · mutmut.readthedocs.io
- Mutation scope
- The documentation says mutmut 3 and later mutate code inside functions, while mutmut 2 has a different execution model for code outside functions.Read 7 Oct 2026 · mutmut.readthedocs.io
- Operating system requirement
- mutmut requires a system with fork support; Windows users must run it inside WSL.Read 7 Oct 2026 · mutmut.readthedocs.io
- Parallel execution
- The project lists parallel and fast execution as features.Read 8 Oct 2026 · mutmut.readthedocs.io
- Pytest
- A basic run invokes pytest on tests in a tests or test folder.Read 8 Oct 2026 · mutmut.readthedocs.io
- Python requirement
- The package requires Python 3.10 or later.Read 8 Oct 2026 · pypi.org
- Security and compliance
- The project repository identifies its license as BSD-3-Clause.Read 7 Oct 2026 · github.com
- Test selection
- It determines which tests to execute for a mutant to speed up mutation testing.Read 8 Oct 2026 · mutmut.readthedocs.io
- Type checker integration
- The documentation supports filtering mutants with mypy or pyrefly and says pyright and ty are not currently supported for this purpose.Read 7 Oct 2026 · mutmut.readthedocs.io
- Windows requirement
- mutmut requires fork support, so the documentation says Windows users must run it inside WSL.Read 8 Oct 2026 · mutmut.readthedocs.io
- Workflow
- Users can browse mutants, write tests to kill them, and rerun individual mutants.Read 8 Oct 2026 · mutmut.readthedocs.io
Strong points and limits
Strong points
- Incremental runs remember completed work.
- Selects tests to execute for each mutant.
- Interactive terminal interface supports mutant browsing.
- Coverage.py can filter mutations to covered lines.
- Exports CI statistics and mutation-score badge JSON.
Limits
- Requires Python 3.10 or later.
- Windows users must run it inside WSL.
- Does not support pyright or ty mutant filtering.
Who it suits
It suits Python developers using pytest who want to check whether their tests catch selected code changes. It also fits workflows that benefit from incremental runs, coverage filtering, or CI statistics.
Verdict
mutmut offers a focused mutation-testing workflow with incremental execution, test selection, and optional coverage and type-checker filters. Windows use requires WSL, and its type-checker filtering excludes pyright and ty.
Where Specifiction places it
- Mutation Testing Tools#16 of 257.2