A framework for performing mutation testing on Go source code to find untested implementation cases.
go-mutesting is a mutation testing framework for Go that automatically modifies source code to create mutants and checks if existing test suites detect these changes. It helps identify untested code, dead code, and test suite gaps by calculating a mutation score based on how many mutants are killed.
Go developers and teams focused on improving test suite quality, especially those working on libraries, tools, or projects where test coverage and correctness are critical.
It provides a structured, extensible way to perform mutation testing in Go with built-in mutators, support for custom exec commands, and a blacklisting system to reduce false positives, offering deeper insights than standard coverage tools.
Mutation testing for Go source code
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows custom mutators and exec commands by implementing interfaces, enabling adaptation to specific project needs beyond built-in features.
Includes branch, expression, and statement mutators to catch bugs like off-by-one errors and dead code, as shown in the example patches.
Provides a mutation score percentage that quantifies test suite effectiveness, helping prioritize improvements beyond line coverage.
Supports external exec commands for custom test suites, not just standard go test, as demonstrated with the test-mutated-package.sh script.
The README admits blacklisting is 'badly implemented' because MD5 checksums change with source code modifications, making maintenance cumbersome.
Requires running the test suite for each mutant, which can be slow and resource-heavy for large projects, impacting integration into fast workflows.
Writing new mutators or exec commands requires understanding Go AST manipulation and framework interfaces, adding complexity for advanced use.