Testing Tool

Mutation Tester

Test the quality of your tests. Generate code mutations and find gaps where your test suite fails to catch bugs.

Get the CLI Tool

Run the mutation tester locally as an MCP server, or try it online below.

npx @clinetools/mutation-test
Requires Node.js 18+
  • 8 mutation operators — arithmetic, comparison, logical, boolean, return, remove, boundary, string
  • Shows exact line and column for every mutation
  • Configurable operator selection and mutation cap
  • Mutation type breakdown with per-operator counts
  • Zero config — just run with npx

How to Use It

Three ways to generate mutations — pick the one that fits your workflow.

1

Try Online

Paste source code below and see all possible mutations — no install needed.

2

Use via CLI

Run as a local MCP server and connect any MCP-compatible client.

npx @clinetools/mutation-test
3

Add to Cline / Claude Code

Add to your MCP settings so your agent generates mutations automatically.

"mutation-test": { "command": "npx", "args": ["@clinetools/mutation-test"] }

MCP Client Configuration (Cline)

{
  "mcpServers": {
    "mutation-test": {
      "command": "npx",
      "args": ["@clinetools/mutation-test"]
    }
  }
}

Claude Code Configuration

# In your project's .mcp.json:
{
  "mcpServers": {
    "mutation-test": {
      "command": "npx",
      "args": ["@clinetools/mutation-test"]
    }
  }
}

Example Prompt: Find Weak Tests

// Prompt to your AI agent:
"Generate mutations for my validation module and
tell me which ones my tests would miss"

// The agent calls:
generate_mutations({
  code: fs.readFileSync("src/validate.ts", "utf-8"),
  operators: ["comparison", "boundary", "boolean"],
  maxMutations: 30
})
Live Demo

Try It Online

Paste source code and see what mutations could be applied to test your tests.

Source Code

Paste a function to generate all possible mutations

Try a demo:

Paste code and click Generate Mutations to see all possible mutants.

Mutations

Understanding Mutation Testing

Mutation testing measures how well your tests actually detect bugs.

What is Mutation Testing?

Mutation testing introduces small changes (mutants) to your code — flipping operators, changing return values, removing statements — and checks whether your tests catch the change. If a test fails, the mutant is "killed." If tests still pass, you have a gap.

Equivalent Mutants

Some mutations produce code that behaves identically to the original — these are "equivalent mutants." They cannot be killed by any test because the behavior hasn't actually changed. They are a known limitation and should be excluded from scoring.

Mutation Score

Mutation score = killed mutants / total mutants. A score of 80%+ is excellent. Unlike line coverage which only measures execution, mutation score measures whether tests actually verify correct behavior. It is a stronger metric for test quality.

When to Use

Use mutation testing on critical business logic, security-sensitive code, and complex algorithms. It is too expensive to run on an entire codebase regularly, so target the code where correctness matters most. Pair with coverage tools for full visibility.

Test Your Tests

Add the Mutation Tester to your agent's toolkit and find the gaps your test suite misses.

View Plans