Supported mutators

Stryker supports a variety of mutators, which are listed below. Do you have a suggestion for a (new) mutator? Feel free to create an issue!

Binary operator

OriginalMutated
a + ba - b
a - ba + b
a * ba / b
a / ba * b
a % ba * b
a < ba <= b
a < ba >= b
a <= ba < b
a <= ba > b
a > ba >= b
a > ba <= b
a >= ba > b
a >= ba < b
a == ba != b
a != ba == b
a === ba !== b
a !== ba === b

Logical operator

OriginalMutated
a && ba || b
a || ba && b

Unary operator

OriginalMutated
+a-a
-a+a

Update operator

OriginalMutated
a++a--
a--a++
++a--a
--a++a

Remove conditionals

OriginalMutated
for (var i = 0; i < 10; i++) { }for (var i = 0; false; i++) { }
while (a > b) { }while (false) { }
do { } while (a > b);do { } while (false);
if (a > b) { } if (true) { }
if (a > b) { } if (false) { }
var x = a > b ? 1 : 2;var x = true ? 1 : 2;
var x = a > b ? 1 : 2; var x = false ? 1 : 2;

Block statement

This mutator removes the content of every block statement. For example the code:

function saySomething() {
    console.log('Hello world!');   
}

becomes:

function saySomething() { 
}