- 论坛徽章:
- 2
|
测试需要Modified condition/decision coverage (MC/DC - MCDC)
如:
if ( (A || B) && C )
{
/* instructions */
}
else
{
/* instructions */
}
mcdc 需要4个case, 变量个数+1 (3+1)
1.A = false/ B = false / C = true ---> decision is evaluated to "false"
2.A = false / B = true / C = true ---> decision is evaluated to "true"
3.A = false / B = true / C = false ---> decision is evaluated to "false"
4.A = true / B = false / C = true ---> decision is evaluated to "true
Modified condition/decision coverage which implies that each boolean variable should be evaluated one time to "true" and one time to "false", and this with affecting the decision's outcome. It means that from a test case to another, changing the value of only one atomic condition will also change the decision's outcome(每个变量单独影响输出);
想写个算法自动生成出来如:
--a----b----c-- result
--F----F----T-- F
--T----F----T-- T
--F----T----F-- F
--F----T----T-- T
求指导啊:wink:
|
|