(a).
(b).如果改变第一个在while循环“I + +”到“i + = 2”。在测试用例中,我们可以得到正确答案2,3,5。但在测试案例2中,得到的结果2,3,5,6,7,这是错误的。因为,它跳过3时检查7。这时发现T2更可能会比T1错误发生几率大。
(c).case t3 = (n = 1)
(d).Node Coverage:TR={0,1,2,3,4,5,6,7,8,9,10,11,12}
Test Path=[1,2,3,4,5,6,7,8,9,2,4,10,11,10,12]
Edge Coverage: TR={(1,2),(2,3),(2,4),(3,5),(5,6),(6,5),(6,7),(7,8),(8,9),(8,2),(9,2),(4,10),(10,11),(11,10),(10,12) Test Path=[1,2,3,5,6,5,6,7,8,2,4,10,11,10,12] [1,2,3,5,6,7,8,9,2,4,10,12] Prime Path Coverage: TR={(5,6,5),(6,5,6),(10,11,10),(11,10,11),(1,2,3,5),(6,7,8,2),(8,9,2),(1,2,4,10,11),(1,2,4,10,12)} Test Path=[1,2,3,5,6,5,6,7,8,2,4,10,12] [1,2,3,5,6,7,8,9,2,4,10,12] [1,2,4,10,11,10,11,10,12] [1,2,4,10,12] (e).[1,2,3,5,6,7,8,9,2,4,10,11,10,12]