软件测试(第三次作业)——图覆盖
(a)
(b)
对于测试用例t1=(n=3)和t2=(n=5),MAXPRIMES = 4时,t1不能检查出错误,而t2则会发生数组越界错。
(c)
对于测试用例t3=(n=1),测试路径不经过while的循环体。
(d)
节点覆盖:TR={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18}
边覆盖:TR={(1,2), (2,3), (2,4), (3,5), (4,14), (5,6), (5,7), (6,8), (7,11), (7,12), (8,9), (8,10), (9,10), (10,2), (11,5), (12,13), (13,8),(14,15),(15,16),(15,17),(16,18),(18,15)}
主路径覆盖:TR={
(1,2,3,5,6,8,9,10)
(1,2,3,5,7,11)
(1,2,3,5,7,12,13,8,9,10)
(1,2,3,5,7,12,13,8,10)
(1,2,4,14,15,16,18)
(1,2,4,14,15,17)
(8,10,2)
(7,11,5)
(16,18,15)
}