Description
Mutant is a mutation testing tool for Ruby. It changes your code in small systematic ways, such as swapping an operator, removing a statement or changing a return value, and then runs your tests against each change. If the tests still pass with a change in place, that mutation is reported as alive, which means your tests do not check that behavior. Each alive mutation gives you a clear choice: keep the mutated code if it is an unnecessary simplification, or add a test that would catch the change. The project was written to address code that AI tools generate, where tests can pass without meaningfully checking the behavior. Mutant works with RSpec, Minitest and Test::Unit, and it can run against Rails applications, including parallel-worker database isolation for PostgreSQL and SQLite. The README lists support for Ruby 3.2 through 4.0 on Linux and macOS, and it stores the 100 most recent results so you can review them without running again. The README also suggests running it on CI in incremental mode.…
Highlights
- Mutates operators, statements and return values
- Reports alive mutations that your tests miss
- Works with RSpec, Minitest and Test::Unit
- Supports Rails apps with parallel test databases
- Keeps the 100 most recent results for review
Ratings & Reviews
No ratings yet
Be the first to rate Mutant.
People also visit

test-gap-analysis
Find caller-visible production changes existing tests would miss through

Undercover for Ruby
Find untested changes and stop shipping untested pull requests

test-guard
Review generated or changed test code against universal testing rules before it
Mutant FAQ
What is mutation testing?
A way to check your tests by changing your code slightly and seeing whether the tests notice. Mutant automates this for Ruby.
What is an alive mutation?
A change that your tests did not catch. The README says you should either keep the mutated code or add the missing test.
Which test frameworks does it support?
RSpec, Minitest and Test::Unit, according to the README.
Which Ruby and Rails versions does it support?
Ruby 3.2, 3.3, 3.4 and 4.0 on Linux and macOS. The README lists Rails 7.2, 8.0 and 8.1 as verified in CI.
Can it run on CI?
Yes. The README suggests running it on CI in incremental mode.
Does it keep old results?
Yes. It records each run to the .mutant/results folder and keeps the 100 most recent, so you can recall them without rerunning.
What are the best Mutant alternatives?
Popular alternatives to Mutant include Vokt, Axolotl and Bugster. See all Mutant alternatives










