In possible to force Pex/Intellitest to look for any possible path condition? I need pex shows me those PC. In pexfonfun/visualstudio 2015, i can see only few PC. For example, infeasible PC aren't shown.
In the next example i get 3 PC:
1) i != 12 && i != 15;
2) i == 15;
3) i == 12;
public static int foo(int i){
int a = 1;
if(i == 12)
a = 1;
if(i == 15)
a = 2;
return a;
}
Why i dont get "i != 12 && i == 15"?
Thanks! :)
>> Why i dont get "i != 12 && i == 15"?
IntelliTest tries to generate a compact test suite with high coverage. For your example, notice that those 3 PC’s are enough to cover all blocks in your code. And therefore, IntelliTest decides that it can stop now. Here are some relevant sections from the IntelliTest Reference Manual that explain this further:
Please let me know how we can improve this manual as well.
OK, now having said that, you can get IntelliTest to generate all PCs as well (although it is not going to exercise any new code paths). Here is how to do that:
PexMethod
attribute.PexMethod
attribute as follows:[PexMethod(TestEmissionFilter = Microsoft.Pex.Framework.Settings.PexTestEmissionFilter.All)]