{"id":31164268,"url":"https://github.com/sivchari/gomu","last_synced_at":"2026-04-02T11:44:11.159Z","repository":{"id":304615041,"uuid":"1019242998","full_name":"sivchari/gomu","owner":"sivchari","description":"🚀 High-performance mutation testing tool for Go","archived":false,"fork":false,"pushed_at":"2025-08-15T09:12:01.000Z","size":3454,"stargazers_count":2,"open_issues_count":26,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-15T09:18:53.694Z","etag":null,"topics":["go","golang","mutation-testing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sivchari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-14T03:09:29.000Z","updated_at":"2025-08-04T03:56:43.000Z","dependencies_parsed_at":"2025-07-14T09:40:53.789Z","dependency_job_id":"6e67c873-37ac-4a7a-b15e-66fc7ffae425","html_url":"https://github.com/sivchari/gomu","commit_stats":null,"previous_names":["sivchari/gomu"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sivchari/gomu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivchari%2Fgomu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivchari%2Fgomu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivchari%2Fgomu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivchari%2Fgomu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sivchari","download_url":"https://codeload.github.com/sivchari/gomu/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivchari%2Fgomu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275902081,"owners_count":25549242,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-19T02:00:09.700Z","response_time":108,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","mutation-testing"],"created_at":"2025-09-19T07:57:10.886Z","updated_at":"2026-04-02T11:44:11.152Z","avatar_url":"https://github.com/sivchari.png","language":"Go","readme":"# gomu\n\nA high-performance mutation testing tool for Go that helps validate the quality of your test suite.\n\n[![Go Version](https://img.shields.io/badge/go-1.21+-blue.svg)](https://golang.org/dl/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## What is Mutation Testing?\n\nMutation testing evaluates the quality of your test suite by introducing controlled changes (mutations) to your code and checking if your tests catch them. If a test fails when code is mutated, the mutation is \"killed\" (good). If tests still pass, the mutation \"survived\" (indicates weak tests).\n\n## Features\n\n### High Performance\n- **Incremental Analysis**: Only test changed files with Git integration\n- **Parallel Execution**: Leverage goroutines for concurrent mutation testing\n- **Efficient AST Processing**: Fast Go code analysis and mutation generation\n\n### Go-Specific Optimizations\n- **Type-Safe Mutations**: Leverage Go's type system for intelligent mutations\n- **Error Handling Patterns**: Specialized mutations for Go error handling\n- **Interface Mutations**: Targeted interface implementation testing\n\n### CI/CD Integration\n- **Quality Gates**: Configurable mutation score thresholds\n- **GitHub Integration**: Automatic PR comments with test results\n- **Multiple Output Formats**: JSON, HTML, and console reporting\n- **Artifact Generation**: CI-friendly report artifacts\n\n### Developer Experience\n- **CLI-Based Configuration**: Simple command-line flags for all settings\n- **Rich Reporting**: Detailed HTML, JSON, and console output formats\n- **Flexible Targeting**: Run on specific files, directories, or changed files only\n- **.gomuignore Support**: Exclude files and directories from mutation testing\n\n### Advanced Analysis\n- **History Tracking**: JSON-based incremental analysis for faster reruns\n- **Git Integration**: Automatic detection of changed files\n- **Mutation Score**: Comprehensive quality metrics\n- **Detailed Reports**: Line-by-line mutation analysis\n\n## Installation\n\n```bash\ngo install github.com/sivchari/gomu/cmd/gomu@latest\n```\n\nOr clone and build:\n\n```bash\ngit clone https://github.com/sivchari/gomu.git\ncd gomu\ngo build -o gomu ./cmd/gomu\n```\n\n## Quick Start\n\n1. **Run on current directory:**\n```bash\ngomu run\n```\n\n2. **Run in CI environment:**\n```bash\ngomu run --ci-mode\n```\n\n3. **Run on specific directory:**\n```bash\ngomu run ./pkg/mypackage\n```\n\n4. **Verbose output:**\n```bash\ngomu run -v\n```\n\n5. **Custom threshold and workers:**\n```bash\ngomu run --threshold 85.0 --workers 8\n```\n\n## Commands\n\n### Basic Usage\n\n- `gomu run [path]` - Run mutation testing on the specified path (default: current directory)\n- `gomu version` - Show version information\n\n### Run Command Options\n\n| Flag | Default | Description |\n|------|---------|-------------|\n| `--ci-mode` | `false` | Enable CI mode with quality gates and GitHub integration |\n| `--threshold` | `80.0` | Minimum mutation score threshold (0-100) |\n| `--workers` | `4` | Number of parallel workers |\n| `--timeout` | `30` | Test timeout in seconds |\n| `--incremental` | `true` | Enable incremental analysis |\n| `--base-branch` | `main` | Base branch for incremental analysis |\n| `--output` | `console` | Output format (console, json, html, text) |\n| `--fail-on-gate` | `true` | Fail build when quality gate is not met |\n| `-v, --verbose` | `false` | Verbose output |\n\n### Examples\n\n```bash\n# Basic run with default settings\ngomu run\n\n# Run with custom threshold\ngomu run --threshold 85.0\n\n# Run in CI mode with HTML output\ngomu run --ci-mode --output html\n\n# Run with more workers and longer timeout\ngomu run --workers 8 --timeout 60\n\n# Run on specific package with verbose output\ngomu run ./internal/mypackage -v\n\n# Disable incremental analysis\ngomu run --incremental=false\n```\n\n## .gomuignore\n\nCreate a `.gomuignore` file in your project root to exclude files and directories from mutation testing. The syntax is similar to `.gitignore`:\n\n```\n# Exclude directories\ncmd/\nvendor/\ntestdata/\n\n# Exclude specific files\n*_generated.go\n\n# Negate pattern (include previously excluded)\n!cmd/important/\n```\n\n## Mutation Types\n\n### Arithmetic Mutations\n- Replace `+` with `-`, `*`, `/`\n- Replace `-` with `+`, `*`, `/`\n- Replace `*` with `+`, `-`, `/`, `%`\n- Replace `/` with `+`, `-`, `*`, `%`\n- Replace `++` with `--` and vice versa\n\n### Conditional Mutations\n- Replace `==` with `!=`, `\u003c`, `\u003c=`, `\u003e`, `\u003e=`\n- Replace `!=` with `==`, `\u003c`, `\u003c=`, `\u003e`, `\u003e=`\n- Replace `\u003c` with `\u003c=`, `\u003e`, `\u003e=`, `==`, `!=`\n- Replace `\u003e` with `\u003e=`, `\u003c`, `\u003c=`, `==`, `!=`\n\n### Logical Mutations\n- Replace `\u0026\u0026` with `||`\n- Replace `||` with `\u0026\u0026`\n- Remove `!` (NOT) operators\n\n### Bitwise Mutations\n- Replace `\u0026` with `|`, `^`\n- Replace `|` with `\u0026`, `^`\n- Replace `^` with `\u0026`, `|`\n- Replace `\u003e\u003e` with `\u003c\u003c`\n- Replace `\u003c\u003c` with `\u003e\u003e`\n\n## CI/CD Integration\n\n### GitHub Actions\n\n```yaml\nname: Mutation Testing\n\non:\n  pull_request:\n    branches: [main]\n\njobs:\n  mutation-test:\n    runs-on: ubuntu-latest\n\n    steps:\n    - uses: actions/checkout@v4\n      with:\n        fetch-depth: 0\n\n    - name: Set up Go\n      uses: actions/setup-go@v5\n      with:\n        go-version: '1.21'\n\n    - name: Install gomu\n      run: go install github.com/sivchari/gomu/cmd/gomu@latest\n\n    - name: Run mutation testing\n      run: gomu run --ci-mode --threshold 80.0\n\n    - name: Upload mutation report\n      uses: actions/upload-artifact@v4\n      if: always()\n      with:\n        name: mutation-report\n        path: |\n          mutation-report.html\n          mutation-report.json\n```\n\n### Quality Gates\n\nQuality gates automatically fail the build when mutation score falls below threshold:\n\n- Configurable minimum mutation score via `--threshold`\n- Fail or continue build via `--fail-on-gate`\n- Detailed failure reporting in CI output\n\n## Example Output\n\n### Console Output\n```\nRunning mutation testing with the following settings:\n  Path: .\n  CI Mode: true\n  Workers: 4\n  Timeout: 30 seconds\n  Output: json\n  Incremental: true\n  Base Branch: main\n  Threshold: 80.0%\n  Fail on Gate: true\n\nAnalyzing files for changes...\nIncremental Analysis Report\n==========================\n- src/calculator.go - File content changed\n- src/utils.go - No previous history\n\nSummary: 2 files need testing, 3 files skipped\nPerformance improvement: 60.0% files skipped\n\nRunning mutation testing on 2 files...\nQuality Gate: PASSED (Score: 84.4%)\n\nMutation testing completed successfully\n```\n\n### HTML Report\n\nThe HTML report provides:\n- Interactive mutation score dashboard\n- File-by-file mutation breakdown\n- Survived mutant details with code snippets\n- Quality gate status and recommendations\n\n## Incremental Analysis\n\ngomu features PITest-inspired incremental analysis that dramatically speeds up repeated runs:\n\n1. **File Hashing**: Tracks changes to source files and tests\n2. **Git Integration**: Automatically detects changed files since last commit\n3. **Result Caching**: Reuses previous results for unchanged code\n4. **JSON Storage**: Transparent, debuggable history format (`.gomu_history.json`)\n\nThis can reduce execution time from minutes to seconds on large codebases.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Inspired by [PITest](https://pitest.org/) for Java\n- Builds upon research in mutation testing\n- Thanks to the Go community for excellent tooling\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsivchari%2Fgomu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsivchari%2Fgomu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsivchari%2Fgomu/lists"}