题目:
答案:
(a) 控制流图:
(b) 令maxprimes = 4;数组越界
(c)t3 = (n=0)
(d)
节点覆盖:
TR={0,1,2,3,4,5,6,7,8,9,10,11,12,13}
边覆盖:
TR={(0,1),(1,2),(2,3),(3,4),(4,5),(4,6),(5,6),(6,3),(3,7),(7,8),(7,9),(8,9),(9,1),(1,10),(10,11), (10,13),(11,12),(12,10)}
主路径覆盖:
TR={
[0,1,9,10,13],
[0,1,9,10,11,12],
[0,1,9,10,13],
[10,11,12,10],
[0,1,2,3,4,5,7,8],
[0,1,2,3,7],
[0,1,2,3,7,8],
[0,1,2,3,4,5],
[0,1,2,3,4,6],
[1,2,3,7,1],
[1,2,3,7,8,1],
[3,4,5,3],
[3,4,6,3],
[11,12,10,13],
[2,3,7,1,9,10,13],
[2,3,7,8,1,9,10,13],
[4,5,3,7,1,9,10,13],
[4,5,3,7,8,1,9,10,13],
[4,6,3,7,1,9,10,13],
[4,6,3,7,8,1,9,10,13],
}