Gooze

Mutation testing for Go that helps you assess the quality of your test suite

What is Mutation Testing?

Mutation testing measures how good your tests are at catching real bugs. It works by making small, intentional changes (mutations) to your code and rerunning your test suite. If a test fails, the mutation is "killed". If tests still pass, the mutation "survived" — your tests didn't notice a behavior change.

Here’s what mutation testing does on each run:

  1. Generate a mutant (a small code change).
  2. Run the test suite against that mutant.
  3. Report killed vs survived and compute a mutation score.

Here’s an example mutation

One common mutation changes a comparison operator (like >>=).

gooze@linux:~/app $ gooze run ./...
--- a/balance.go
+++ b/balance.go
@@ function label(balance int) string @@
-if balance > 0 {
+if balance >= 0 {
return "positive"
}

Get Started in 3 Steps

1

Install Gooze

Install with a single command using Go's package manager

go install gooze.dev/pkg/gooze@latest
2

Run Mutation Tests

Execute mutation testing across your codebase

gooze run ./...
3

View Results

Get detailed insights into your test suite's effectiveness

gooze view