Skip to content

v1.0.0 — Initial stable release

Choose a tag to compare

@ericodx ericodx released this 29 Mar 00:53
096c3d6

The first stable release of swift-mutation-testing — an AST-based CLI that finds untested behaviour in Swift codebases by systematically introducing code mutations and verifying that your test suite detects them.


What's included

Mutation pipeline

  • Two-phase architecture: discovery (AST parsing + mutant identification + schematization) followed by execution (sandbox → build → test → results)
  • Schema-based execution: all mutants are embedded behind a runtime switch and the project is built exactly once — no per-mutant recompilation
  • The original project is never modified — all mutations happen inside an isolated sandbox in $TMPDIR
  • Parallel test execution via withThrowingTaskGroup across cloned simulators
  • Incompatible mutants (those that cannot be schematized) are handled in a sequential fallback path with one build per file

Mutation operators

  • RelationalOperatorReplacement — replaces > >= < <= == !=
  • BooleanLiteralReplacement — swaps truefalse
  • LogicalOperatorReplacement — swaps &&||
  • ArithmeticOperatorReplacement — replaces + - * / %
  • NegateConditional — wraps conditions in !()
  • SwapTernary — swaps ternary branches
  • RemoveSideEffects — removes standalone function call statements

Platform support

  • macOS — runs directly without a simulator
  • iOS, tvOS, watchOS — parallel execution via a pool of cloned simulators
  • Destination specified as a standard xcodebuild destination string

Developer experience

  • swift-mutation-testing init generates a project-scoped .swift-mutation-testing.yml with auto-detected scheme and destination
  • @SwiftMutationTestingDisabled attribute suppresses mutations within any function, type, or property scope
  • --operator and --disable-mutator flags for per-run operator control
  • --quiet flag for CI-friendly output
  • --no-cache flag to force a full re-run

Reports

  • Text summary always printed to stdout — per-file scores, survived mutants, and overall score
  • JSON report (--output) in Stryker-compatible format
  • Interactive HTML report (--html-output) with colour-coded per-file dashboards
  • SonarQube Generic Issue Import report (--sonar-output) — survived mutants as MAJOR CODE_SMELL, no-coverage mutants as MINOR

Caching

  • Results are persisted at .swift-mutation-testing-cache/results.json, keyed by SHA256 of source and test file contents
  • Unchanged mutants are skipped entirely on subsequent runs

Requirements

  • macOS 15+
  • Swift 6.2+
  • Xcode project with a valid scheme and test target

Installation

See the Installation Guide for Homebrew, pre-built binary, and build from source instructions.


What's Changed

New Contributors

Full Changelog: https://github.com/ericodx/swift-mutation-testing/commits/v1.0.0