Top AI Repos β open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
𧬠Go Mutation Testing
| Date | Stars |
|---|---|
| 2026-07-24 | 281 |
| 2026-07-25 | 281 |
| 2026-07-28 | 281 |
| 2026-07-30 | 281 |
| 2026-08-06 | 281 |
Today
β stars today
This week
β stars this week
This month
β stars this month
Momentum
0.0
growth rate 0.00%/day
<h1 align="center">
<a href="https://github.com/gtramontina/ooze">
<img src=".assets/logo.svg" alt="ooze logo">
</a>
</h1>
<p align="center">
<a href="https://pkg.go.dev/github.com/gtramontina/ooze"><img src="https://pkg.go.dev/badge/github.com/gtramontina/ooze.svg" alt="Go Reference"></a>
<a href="https://goreportcard.com/report/github.com/gtramontina/ooze"><img src="https://goreportcard.com/badge/github.com/gtramontina/ooze" alt="Go Report Card"></a>
<a href="https://github.com/gtramontina/ooze/actions/workflows/ci.yml"><img src="https://github.com/gtramontina/ooze/actions/workflows/ci.yml/badge.svg" alt="CI Workflow"></a>
<a href="https://github.com/gtramontina/ooze/actions/workflows/mutation.yml"><img src="https://github.com/gtramontina/ooze/actions/workflows/mutation.yml/badge.svg" alt="Mutation Testing Workflow"></a>
</p>
## Mutation Testing?
Mutation testing is a technique used to assess the quality and coverage of test suites. It involves introducing controlled changes to the code base, simulating common programming mistakes. These changes are, then, put to test against the test suites. A failing test suite is a good sign. It indicates that the tests are identifying mutations in the codeβit "killed the mutant". If all tests pass, we have a surviving mutant. This highlights an area with weak coverage. It is an opportunity for improvement.
There are different types of changes that mutation tests can perform. A common collection usually include:
* Changing an operator;
* Replacing a constant;
* Removing a statement;
* Increasing/decreasing numbers;
* Flipping booleans;
Mutations can also be domain/application-specific. Although, these are up to the maintainers of such application to develop.
It is worth mentioning that mutation tests can be quite expensive to run. Especially on larger code bases. And the reason is that for every mutation, on every source file, the entire suite of tests has to run. One can look at the bright side of this and think as an incentive to keep the test suites fast.
Mutation testing is a great ally in developing a robust code base and a reliable set of test suites.
## Quick Start
### Prerequisites
In order to ensure that you get accurate results, make sure that test suite that Ooze will run is passing. Otherwise, Ooze will report as if all mutants have been killed.
When Ooze reports that it found a living mutant, it will print a diff of the changes the virus made to the source file. The mutant source is printed using Go's [`go/format`](https://pkg.go.dev/go/format) package. This means that, if your source code isn't gofmt'd, the diff may contain some formatting changes that are not relevant to the mutation. This isn't a prerequisite per se, but for a better experience, it is recommended that you run `gofmt` on your source files.
### Installation
1. Install ooze:
```shell
go get github.com/gtramontina/ooze
```
This pulls the latest version of Ooze and updates your `go.mod` and `go.sum` to reference this new dependency.
2. Create a `mutation_test.go` file in the root of your repository and add the following:
```go
//go:build mutation
package main_test
import (
"testing"
"github.com/gtramontina/ooze"
)
func TestMutation(t *testing.T) {
ooze.Release(t)
}
```
The build tag is so you can better control _when_ to run these tests (see the next step). This is a test as you'd write any other Go test. What differs is what the test actually does. And this is where it delegates to Ooze, by `Release`ing it.
3. Run with:
```shell
go test -v -tags=mutation
```
This will execute all tests in the current package including the sources tagged with `mutation`. This assumes that the above is the only test file in the root of your project. If you have other tests, you may want to put the mutation tests in a separate package, under `./mutation` for example, and configure Ooze to use `..` as the repository root (see [`WithRepositoryRoot`](#Settings) below).
If `-v` Excerpt of 17,060 characters
Read on GitHubWould you bet a product on this? Bounded 0β100 and slow moving.
matched fp:6a07faa28b423fc9, topic:testing