软件测试作业——三

时间:2022-09-13 18:10:07

作业见《软件测试基础》中文版49页第7题。英文版63页

a)

               软件测试作业——三

b) 令MAXPRIMES = 4,t1不能检查出错误,t2发生数组越界,使得t2比t1更容易发现。

c)t3=(n=1)

d)节点覆盖:TR={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}

  边覆盖:TR={(1,2),(2,3),(2,12),(3,4),(4,5),(5,6),(6,8),(8,5),(6,7),(7,9),

            (5,9),(9,10),(10,11),(9,11),(12,13),(13,14),(14,15),(15,13),(13,16)}

  主路径:TR={(1,2,3,4,5,6,8),(1,2,3,4,5,6,7,9,11),(1,2,3,4,5,6,7,9,10,11)

                         (1,2,12,13,14,15),(1,2,12,13,16),(1,2,3,4,5,9,10,11),(1,2,3,4,5,9,11),

                        (2,3,4,5,6,7,9,11,2),(2,3,4,5,6,7,9,10,11,2),(2,3,4,5,9,10,11,2),(2,3,4,5,9,11,2)

                        (3,4,5,6,7,9,11,2,3),(3,4,5,6,7,9,10,11,2,3),(3,4,5,9,10,11,2,3),(3,4,5,9,11,2,3)

        (4,5,6,7,9,11,2,3,4),(4,5,6,7,9,10,11,2,3,4),(4,5,9,10,11,2,3,4),(4,5,9,11,2,3,4)

                         (5,6,8,5),(5,6,7,9,10,11,2,3,4,5),(5,6,7,9,11,2,3,4,5),(5,9,10,11,2,3,4,5)

         (5,9,11,2,3,4,5),(6,8,5,6),(6,7,9,10,11,2,3,4,5,6),(6,7,9,11,2,3,4,5,6)

          (7,9,10,11,2,3,4,5,6,7),(7,9,11,2,3,4,5,6,7),(8,5,6,8)(9,10,11,2,3,4,5,6,7,9)

          (9,10,11,2,3,4,5,9),(9,11,2,3,4,5,6,7,9)(9,11,2,3,4,5,9),(10,11,2,3,4,5,6,7,9,10)

          (10,11,2,3,4,5,9,10)(11,2,3,4,5,6,7,9,11)(11,2,3,4,5,6,7,9,10,11)(11,2,3,4,5,9,10,11)

          (13,14,15,13),(14,15,13,14),(15,13,14,15)}