hcoles / pitest

State of the art mutation testing system for the JVM
Apache License 2.0
1.67k stars 358 forks source link

MemberVariableMutator removes assignments to final members #668

Open Vampire opened 5 years ago

Vampire commented 5 years ago

Should the MemberVariableMutator remove assignments to final members? This code would never compile actually, so noone could actually introduce this error. Replacing the assignment by a different assignment would make sense, but this is already handled by other mutators I think.

Vampire commented 1 year ago

Especially removing the assignment of null in certain constructor parts to a final variable is not killable. While it would not compile, the bytecode is valid but the variable is still null, so from the tests perspective, at least removing a null assignment to a final variable makes no sense at all.