Is your feature request related to a problem? Please describe.
It's often the case that production codebases include support/monitoring/logging code that, if mutated, has little-to-no impact (or, alternatively, isn't worth testing the result of - e.g. calls to a logging function). If your codebase has lots of logging, this can generate large numbers of needless false positives and greatly slow down the mutation test run.
Describe the solution you'd like
Perhaps an addition to the mutators element in infection.json, along the lines of:
{
"mutators": {
"ArrayItem": {
"excludeCallsTo": [
"Namespace\\Class::writeToLog",
"OtherNamespace\\SomeOtherClass"
]
}
}
}
Obviously this wouldn't necessarily be 100% given PHP's extremely loose ways of calling functions (for instance, it might not catch something like $level = "info"; Log::$level(...)), but it would still save a lot of false positives over code like this.
Describe alternatives you've considered
Excluding every single log line, line-by-line, using the existing exclusion syntax. Doesn't scale well at all, and extremely brittle.
Is your feature request related to a problem? Please describe.
It's often the case that production codebases include support/monitoring/logging code that, if mutated, has little-to-no impact (or, alternatively, isn't worth testing the result of - e.g. calls to a logging function). If your codebase has lots of logging, this can generate large numbers of needless false positives and greatly slow down the mutation test run.
Describe the solution you'd like
Perhaps an addition to the
mutatorselement ininfection.json, along the lines of:{ "mutators": { "ArrayItem": { "excludeCallsTo": [ "Namespace\\Class::writeToLog", "OtherNamespace\\SomeOtherClass" ] } } }Obviously this wouldn't necessarily be 100% given PHP's extremely loose ways of calling functions (for instance, it might not catch something like
$level = "info"; Log::$level(...)), but it would still save a lot of false positives over code like this.Describe alternatives you've considered
Excluding every single log line, line-by-line, using the existing exclusion syntax. Doesn't scale well at all, and extremely brittle.