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
Code tested:
public static bool Is18OrOlder(int age)
{
return age >= 18;
}
Existing tests:
[Fact]
public void Minor_Test()
{
Assert.False(AgeControl.Is18OrOlder(0));
}
[Fact]
public void Equal_Test()
{
Assert.True(AgeControl.Is18OrOlder(18));
}
Both of them pass green when >= is replaced by == , the mutation into == should force the programmer to write a test for higher value than 18 in our example
The text was updated successfully, but these errors were encountered:
We currently place 2 mutations for >= (<= and >). The <= mutation already forces the programmer to write a test for the value higher than 18.
As far as I know we tackle all edge cases with these 2 mutations. But if we could simplify by just placing 1 mutation that would improve our performance. We could look into, if this mutation covers the same edge cases.
Example:
Code tested:
public static bool Is18OrOlder(int age)
{
return age >= 18;
}
Existing tests:
[Fact]
public void Minor_Test()
{
Assert.False(AgeControl.Is18OrOlder(0));
}
[Fact]
public void Equal_Test()
{
Assert.True(AgeControl.Is18OrOlder(18));
}
Both of them pass green when >= is replaced by == , the mutation into == should force the programmer to write a test for higher value than 18 in our example
The text was updated successfully, but these errors were encountered: