https://github.com/leonidboykov/go-mutesting
Mutation testing for Go source code. Fork from https://github.com/zimmski/go-mutesting
https://github.com/leonidboykov/go-mutesting
Last synced: 3 days ago
JSON representation
Mutation testing for Go source code. Fork from https://github.com/zimmski/go-mutesting
- Host: GitHub
- URL: https://github.com/leonidboykov/go-mutesting
- Owner: leonidboykov
- License: mit
- Created: 2025-02-28T13:09:38.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-11-14T08:58:17.000Z (7 months ago)
- Last Synced: 2025-11-14T10:05:44.720Z (7 months ago)
- Language: Go
- Homepage:
- Size: 391 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-mutesting
[](https://pkg.go.dev/github.com/leonidboykov/go-mutesting)
[](https://github.com/leonidboykov/go-mutesting/actions/workflows/go-test.yml)
[](https://codecov.io/github/leonidboykov/go-mutesting)
go-mutesting is a framework for performing mutation testing on Go source code. Its main purpose is to find source code,
which is not covered by any tests.
## Quick Example
go-mutesting includes a binary which is go-getable.
```bash
go get -t -v github.com/leonidboykov/go-mutesting/...
```
The following command mutates the go-mutesting project with all available mutators.
``` bash
go-mutesting github.com/leonidboykov/go-mutesting/...
```
The execution of this command prints for every mutation if it was successfully tested or not. If not, the source code
patch is printed out, so the mutation can be investigated. The following shows an example for a patch of a mutation.
``` diff
for _, d := range opts.Mutator.DisableMutators {
pattern := strings.HasSuffix(d, "*")
- if (pattern && strings.HasPrefix(name, d[:len(d)-2])) || (!pattern && name == d) {
+ if (pattern && strings.HasPrefix(name, d[:len(d)-2])) || false {
continue MUTATOR
}
}
```
The example shows that the right term `(!pattern && name == d)` of the `||` operator is made irrelevant by substituting
it with `false`. Since this change of the source code is not detected by the test suite, meaning the test suite did not
fail, we can mark it as untested code.
For the rest of the readme, check out the documentation at .
## Can I make feature requests and report bugs and problems?
Sure, just submit an [issue via the project tracker](https://github.com/leonidboykov/go-mutesting/issues/new) and we will see what I can do.
## Slop-free software
This software is 100% human-authored. All AI-generated contributions will be rejected.