Skip to content
mutastic

Swift edition

Operators

An operator is a kind of change; each mutant is one operator applied at one place. The Swift edition uses the other editions’ ids wherever the meaning is the same, so a rule, a script or an agent that names mutastic/boundary means one thing in all three, and adds three of Swift’s own, under swift/.

A run uses defaults unless --operators says otherwise: --operators=stronger adds the stronger set to the defaults, --operators=extended or all adds Swift’s own too, and a list of ids separated by commas picks exactly those. Each card links to its operator’s section here.

  • Conditions: comparisons, conditions, and how two combine.
  • Arithmetic: operators, signs and bits.
  • Returns and errors: what a function returns, and what a try does.
  • Calls and writes: calls, assignments and writes left out.
  • Arguments: what a call is given.
  • Library methods: the standard library’s methods swapped for their counterparts.
  • Iterators: a chain’s matches and stages, where the Java edition has streams.
  • Optionals: ?? and optional chains, where the Java edition has Optional.
OperatorSetPage
mutastic/boundarydefaultsConditions
mutastic/remove-conditionaldefaultsConditions
mutastic/logical-connectordefaultsConditions
mutastic/comparisonstrongerConditions
mutastic/other-comparisonstrongerConditions
swift/remove-guardextendedConditions
mutastic/mathdefaultsArithmetic
mutastic/other-arithmeticstrongerArithmetic
mutastic/remove-negationstrongerArithmetic
mutastic/bitwisestrongerArithmetic
mutastic/return-valuedefaultsReturns and errors
mutastic/unwrap-trydefaultsReturns and errors
swift/try-nilextendedReturns and errors
mutastic/remove-void-calldefaultsCalls and writes
mutastic/remove-discarded-calldefaultsCalls and writes
mutastic/remove-assignmentdefaultsCalls and writes
mutastic/remove-field-writestrongerCalls and writes
mutastic/boolean-constantstrongerArguments
library/swap-stringdefaultsLibrary methods
library/swap-mathdefaultsLibrary methods
library/swap-endsstrongerLibrary methods
library/swap-index-ofstrongerLibrary methods
stream/swap-matchdefaultsIterators
stream/remove-stagedefaultsIterators
optional/no-defaultstrongerOptionals
optional/always-defaultstrongerOptionals
swift/chain-nilextendedOptionals