You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you saying only about cases when variable (not negated) is used in an if statement?
because, we already have other mutators that do
- if (! $var)+ if ($var)- if ($var === 1)+ if ($var !== 1)
...
If yes, then probably makes sense, but we will definitely need to analyze the results of this mutator (how many mutants are created / escaped / killed) to understand if it's useful one or not
Maybe better example would be with with return false.
The real life scenario would be some validator like this:
functionisValid($a, $b, $c)
{
if ($a || someGlobalFunction($a)) {
returntrue;
}
if ($b) {
returnfalse;
}
if ($c) {
returntrue;
}
returnfalse;
}
and adding false && (...) to the condition (not true || as my first post - but maybe both mutation make sense) would verify if each condition is useful because maybe the other ifs handle all tests cases.
we will definitely need to analyze the results of this mutator
Is there any good practise flow for that? Or do you mean writing the mutator and running it in some "random" repositories and see the output?
Would it make sense to test if the
if
condition is useful?The mutation would be:
The text was updated successfully, but these errors were encountered: