Skip to content

Comments

refactor: use overlay-based mutation for crash-safe testing#43

Merged
sivchari merged 4 commits intomainfrom
feat/overlay-mutation-testing
Jan 6, 2026
Merged

refactor: use overlay-based mutation for crash-safe testing#43
sivchari merged 4 commits intomainfrom
feat/overlay-mutation-testing

Conversation

@sivchari
Copy link
Owner

@sivchari sivchari commented Jan 6, 2026

Summary

  • Replace file-based mutation approach with Go's -overlay flag to ensure original source files are never modified during mutation testing
  • Remove SourceMutator and file lock mechanism in favor of OverlayMutator that creates isolated temporary files
  • Update README.md to reflect current CLI-based configuration and remove outdated YAML config documentation

Changes

New Files

  • internal/execution/overlay.go - OverlayMutator implementation using Go's overlay feature
  • internal/execution/overlay_test.go - Comprehensive tests for overlay functionality

Modified Files

  • internal/execution/engine.go - Updated to use overlay for compilation and test execution
  • internal/execution/engine_test.go - Updated tests for overlay-based engine
  • README.md - Updated to match actual CLI implementation

Removed Files

  • internal/execution/mutator.go - Old file-based mutation approach
  • internal/execution/mutator_test.go - Tests for removed mutator

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
  • 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

Replace file-based mutation approach with Go's -overlay flag to ensure
original source files are never modified during mutation testing.

Key changes:
- Add OverlayMutator that creates temporary mutated files and overlay.json
- Update Engine to use overlay for compilation checks and test runs
- Remove SourceMutator and file lock mechanism (no longer needed)
- Enable true parallel execution without file contention
- Update README.md to reflect current CLI-based configuration

Benefits:
- Crash-safe: original files remain intact even if process is killed
- True parallelism: each mutation uses isolated overlay files
- Simpler: no file locks or rollback logic required
- Add missing whitespace for wsl_v5 linter in multiple files
- Replace deprecated homebrew_casks.binary property
- Replace deprecated conflicts.formula with conflicts.cask
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

🧬 Mutation Testing Results

Quality Gate: PASSED

Overall Mutation Score: 15.2%
Total Mutants: 165
Killed: 25

Files with Mutations

File Score Mutants Killed
...ner/work/gomu/gomu/internal/execution/engine.go 0.0% 65 0
...er/work/gomu/gomu/internal/execution/overlay.go 25.0% 100 25

Generated by gomu mutation testing

@sivchari sivchari merged commit 8f3ff61 into main Jan 6, 2026
3 of 4 checks passed
@sivchari sivchari deleted the feat/overlay-mutation-testing branch January 6, 2026 04:19
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