Swift edition
Calls and writes
Operators that leave something out: a call, an assignment or a write to a property. They ask whether a test notices the side effect, not only the return value.
| Operator | Changes | Set |
|---|---|---|
mutastic/remove-void-call | a call whose result isn’t used, left out | defaults |
mutastic/remove-discarded-call | _ = call() left out | defaults |
mutastic/remove-assignment | an assignment to a local left out | defaults |
mutastic/remove-field-write | an assignment to a property left out | stronger |
The mutants each makes, on samples/operators/Sources/Operators/Calls.swift:
mutastic mutants samples/operators --at=Sources/Operators/Calls.swift:1-99 --operators=mutastic/remove-void-call,mutastic/remove-discarded-call,mutastic/remove-assignment,mutastic/remove-field-writem1c3623af Sources/Operators/Calls.swift:10:5 mutastic/remove-void-call items.append(item) is removed in Basket.addmf973a79e Sources/Operators/Calls.swift:22:5 mutastic/remove-discarded-call _ = visit() is removed in Basket.addOnVisitm156490fb Sources/Operators/Calls.swift:23:5 mutastic/remove-void-call add(item) is removed in Basket.addOnVisitm4edb9aa5 Sources/Operators/Calls.swift:28:5 mutastic/remove-field-write items = [] is removed in Basket.clearmb195cb7d Sources/Operators/Calls.swift:34:5 mutastic/remove-assignment paid = total + tip is removed in Basket.withTipno estimate: no run is recorded here yet; run once to get estimates, or add --estimate5 mutantsRemove void call
Section titled “Remove void call”mutastic/remove-void-call, in the defaults. A call made for what it does, whose result nothing uses, is removed. A call a block needs to compile, one that never returns or one that’s all a closure or a getter gives back, isn’t.
Remove discarded call
Section titled “Remove discarded call”mutastic/remove-discarded-call, in the defaults. A call whose result is thrown away with _ = is removed.
Remove assignment
Section titled “Remove assignment”mutastic/remove-assignment, in the defaults. An assignment to a local variable is removed, other than its first value, which the code needs to compile.
Remove field write
Section titled “Remove field write”mutastic/remove-field-write, in stronger. An assignment to a property is removed, other than one an initializer must make.
- Every operator, in one table.