例如表达式Z:=(A而不是B)或(C xor D); 以下是唯一可能的测试用例组合吗?
testCaseNO 1 2 3 4 5
Input A T T F F F
Input B T F T T T
Input C F F F F T
Input D F F F T F
Output Z F T F T T
或者以下给出MCDC也可以正常工作?
testCaseNO 1 2 3 4 5
Input A T T T F F
Input B T F T T F
Input C F F T F T
Input D F F T T T
Output Z F T F T F
答案 0 :(得分:1)
我不认为第二个适用于MCDC。您没有说明输入A独立地影响输出。在测试用例1中,A是T,输出Z是F.在测试用例4A中,A是F,输入D也变化。所以你不知道哪一个将输出改为T。
答案 1 :(得分:1)
Neither of your examples satisfies MC/DC.
To evaluate whether test cases satisfy MC/DC, a good approach is to pair up test cases, so that each pair:
There should be one such pair for every condition. So, for the first example:
In the second example, the only pair that changes a single input value is cases 1 and 2. All other pairs change two or more values.
A test set that does provide full MC/DC in this case is:
test case No 1 2 3 4 5
Input A T T F F F
Input B T F F F F
Input C F F F T F
Input D F F F F T
Output Z F T F T T