Skip to content

Comments

refactor: overlay-based mutation and improved output handling#44

Merged
sivchari merged 3 commits intomainfrom
feat/overlay-mutation-and-output-improvements
Jan 8, 2026
Merged

refactor: overlay-based mutation and improved output handling#44
sivchari merged 3 commits intomainfrom
feat/overlay-mutation-and-output-improvements

Conversation

@sivchari
Copy link
Owner

@sivchari sivchari commented Jan 6, 2026

Summary

  • Replace file-based mutation approach with Go's -overlay flag for crash-safe testing
  • Improve output handling: default to console summary, file formats write only to files
  • Add progress indicators during mutation testing execution

Changes

Overlay-based Mutation (Crash-safe)

  • New: internal/execution/overlay.go - OverlayMutator using Go's overlay feature
  • New: internal/execution/overlay_test.go - Comprehensive tests for overlay functionality
  • Removed: internal/execution/mutator.go - Old file-based mutation approach
  • Removed: internal/execution/mutator_test.go - Tests for removed mutator
  • Modified: internal/execution/engine.go - Updated to use overlay for compilation and test execution

Output Handling Improvements

  • Default output: Changed from json to console (summary only to stdout)
  • File formats: --output json/html/text now write to files without stdout spam
  • Progress indicators: Show per-file processing status during execution
  • Example output:
    Processing 3 file(s)...
    [1/3] foo.go (5 mutants) -> 3/5 killed
    [2/3] bar.go (no mutants)
    [3/3] baz.go (2 mutants) -> 2/2 killed
    
    Mutation Testing Results
    ========================
    Files: 2/3 processed
    Mutants: 7 total
    Killed: 5 (71.4%)
    ...
    

Other Fixes

  • Fix wsl_v5 lint errors across multiple files
  • Fix goreleaser deprecated properties (homebrew_casks.binary, conflicts.formula)
  • Update README.md to reflect current CLI implementation

Benefits

  • Crash-safe: Original files remain intact even if process is killed mid-execution
  • True parallelism: Each mutation uses isolated overlay files, eliminating file contention
  • Better UX: Clear progress during execution, clean output for file formats
  • Simpler code: No file locks or rollback logic required

Test plan

  • All existing tests pass with -race flag
  • Parallel execution test (TestOverlayParallelExecution) verifies concurrent safety
  • Linter checks pass
  • goreleaser check passes

@sivchari sivchari force-pushed the feat/overlay-mutation-and-output-improvements branch 2 times, most recently from 451aec1 to c087d87 Compare January 8, 2026 09:01
Replace file-based mutation approach with Go's -overlay flag.

- Add OverlayMutator using Go's overlay feature for isolated mutations
- Remove old file-based mutator that modified files in place
- Each mutation uses isolated overlay files, eliminating file contention
- Original files remain intact even if process is killed mid-execution
- Change default output from json to console (summary only to stdout)
- File formats (json/html/text) now write to files without stdout spam
- Add progress indicators showing per-file processing status
- Respect --output flag and generate only specified format
- Fix deprecated homebrew_casks.binary property
- Fix deprecated conflicts.formula property
- Update README.md to reflect current CLI implementation
- Add .gitignore for examples directory
@sivchari sivchari force-pushed the feat/overlay-mutation-and-output-improvements branch from c087d87 to 35e4040 Compare January 8, 2026 09:08
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

🧬 Mutation Testing Results

Quality Gate: PASSED

Overall Mutation Score: 24.6%
Total Mutants: 560
Killed: 138

Files with Mutations

File Score Mutants Killed
...er/work/gomu/gomu/internal/execution/overlay.go 25.0% 100 25
...ner/work/gomu/gomu/internal/report/generator.go 51.0% 96 49
/home/runner/work/gomu/gomu/pkg/gomu/engine.go 21.4% 299 64
...ner/work/gomu/gomu/internal/execution/engine.go 0.0% 65 0

Generated by gomu mutation testing

@sivchari sivchari merged commit d340977 into main Jan 8, 2026
4 checks passed
@sivchari sivchari deleted the feat/overlay-mutation-and-output-improvements branch January 8, 2026 09:21
This was referenced Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant