Skip to content
mutastic

Swift edition

Differences from the Java edition

If you know the Java edition, most of the Swift edition works the same way: the same commands and options, the same cards and formats, the same ids for the same operators, mutastic.yaml, baselines, ignores, the gate and next. This page is only where you’d do something different.

  • The project: a SwiftPM package’s directory, or a directory with an Xcode project or workspace, where the Java edition takes a Maven or Gradle module. An Xcode project’s scheme is chosen with --scheme, where the Java edition names a module. See Running on your project.
  • Build arguments: what follows -- goes to swift build, where the Java edition’s goes to Maven or Gradle.
  • Its files: under .build/mutastic, where the Java edition’s are under build/mutastic or target/mutastic.
  • The toolchain: Swift 6.0 or later, and on macOS Xcode 16 or later. There’s no JDK to find.
  • One build for every mutant, each behind a switch, where the Java edition swaps each mutant’s classes in a running JVM. A mutant that doesn’t compile is withdrawn and the build is made again. See How the tests are run.
  • A crash ends the test process: a mutant that traps takes every test still running with it, and mutastic runs those tests again one at a time to find the one that crashed.
  • Swift Testing runs tests side by side in one process, in an order that changes, so a test that depends on another’s leftovers is checked alone before its catch counts.
  • Swift’s own: swift/remove-guard, swift/try-nil and swift/chain-nil, in extended.
  • Where Java has streams and Optional: Swift’s collection chains (contains(where:), allSatisfy, filter, sorted) and its optionals (??, ?.).
  • What Swift hasn’t got: operators on shapes Swift doesn’t have, or that the Swift edition doesn’t make yet, such as the argument and switch operators. Operators lists every one it has.
  • Plugins: there are no filter or operator plugins.