[英]Pex: How to obtain all Path Conditions (PC)?
In possible to force Pex/Intellitest to look for any possible path condition? 是否有可能迫使Pex / Intellitest寻找任何可能的路径条件? I need pex shows me those PC.
我需要pex给我看那些PC。 In pexfonfun/visualstudio 2015, i can see only few PC.
在pexfonfun / visualstudio 2015中,我只能看到很少的PC。 For example, infeasible PC aren't shown.
例如,未显示不可行的PC。
In the next example i get 3 PC: 在下一个示例中,我得到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"? 为什么我没有得到“ i!= 12 && i == 15”?
Thanks! 谢谢! :)
:)
>> Why i dont get "i != 12 && i == 15"? >>为什么我没有得到“ i!= 12 && i == 15”?
IntelliTest tries to generate a compact test suite with high coverage. IntelliTest尝试生成具有高覆盖率的紧凑型测试套件。 For your example, notice that those 3 PC's are enough to cover all blocks in your code.
对于您的示例,请注意那三台PC足以覆盖您代码中的所有块。 And therefore, IntelliTest decides that it can stop now.
因此,IntelliTest决定可以立即停止。 Here are some relevant sections from the IntelliTest Reference Manual that explain this further:
以下是《 IntelliTest参考手册》中的一些相关部分,进一步说明了这一点:
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). 好的,话虽如此,您也可以使IntelliTest也生成所有PC(尽管它不会使用任何新的代码路径)。 Here is how to do that:
这样做的方法如下:
PexMethod
attribute. PexMethod
属性的方法。 PexMethod
attribute as follows: [PexMethod(TestEmissionFilter = Microsoft.Pex.Framework.Settings.PexTestEmissionFilter.All)]
PexMethod
属性,使PexMethod
条件状态,以生成更多PC并发出测试,如下所示: [PexMethod(TestEmissionFilter = Microsoft.Pex.Framework.Settings.PexTestEmissionFilter.All)]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.