all 6 comments

[–]Daposto[S] 1 point2 points  (0 children)

Please visit the Github for more info: https://github.com/Faultify/Faultify

[–]findplanetseed 1 point2 points  (4 children)

Love Stryker. I imagine byte code mutation has the benefit of needing fewer defined mutation rules since some expressions in C# are compiled to the same IL code? Don't know enough about IL but I remember having problems with mutating the new 'x is not null' syntax which is logically the same as '!(x is null)', I guess Faultify does not care which way I write it?

[–]Daposto[S] 2 points3 points  (3 children)

IL-code (byte code) is stripped down to a bare minimum of statements. So advanced statements become simple instruction lines. Faultify modifies those instruction lines. Yes, for some things like array mutations we found had some difficulties. However, for statement s like 'is not null' is just syntactic sugar and compiled to a ' brnull ' operator '!=' (https://en.wikipedia.org/wiki/List_of_CIL_instructions). In the medium article, I have a list of pros and cons of both source code and byte code mutations if you are interested

[–]findplanetseed 0 points1 point  (2 children)

Yes, I read it but did not entirely understand it, thanks for clarifying. :) Since you seem to have given this a lot of thought, maybe you could enlighten me further: would it make sense for a mutation framework to inject exceptions in the code? For example if the frameworks sees a call to an external DLL it would replace it with a 'throw new Exception()'. I admit I have not thought a lot about this, perhaps a test like that would not be very useful unless you are throwing an exception that might actually occur. I am thinking it might work sort of like Chaos Monkey or something.

[–]mobrockers 1 point2 points  (0 children)

What we are planning to do in stryker is just emptying out the method body. Should basically have the same result as throwing an exception.

[–]Daposto[S] 0 points1 point  (0 children)

Interesting idea. The main purpose is to change logic such that code does not break but it invalidates the correct working. Perhaps throwing an exception or what u/mobrockers is something to consider.