软测hw3

Posted taehyungv97

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了软测hw3相关的知识,希望对你有一定的参考价值。

一:(a)

技术分享图片

对于图中表示的细节:

1int curPrime....curPrime=2

2~3:numPrimes<n

3:curPrime++;isPrime=true;

4:int i=0

5~6:i<=numPrimes-1

6~7:curPrime%primes[i]==0(T)

6~8:curPrime%primes[i]==0(F)

7:isPrime=false;break;

8:i++

5~9:i>numPrimes-1

9~10:isPrime(T)

9~11:isPrime(F)

2~12numPrimes>=n

12:int i=0

13~14:i<=numPrimes-1

14:system.out.println..

15:i++

13~16:i>numPrimes-1

(b) set MAXPRIMES=4, then t2 will get the resulting array bounds error

(c)n=1

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

EC:TR={(1,2),(2,3),(2,12),(3,4),(4,5),(5,6),(6,7),(6,8),(7,9),(8,5),(5,9),(9,10),(9,11),(10,11),(11,2),(12,13),(13,14),(13,16),(14,15),(15,13)}

PPC:{(1,2,3,4,5,6,8),(1,2,3,4,5,6,7,9,10,11),(1,2,3,4,5,6,7,9,11),(1,2,3,4,5,9,10,11),(1,2,3,4,5,9,11),(5,6,8,5),(6,8,5,6),(1,2,12,13,16),(1,2,12,13,14,15),{14,15,13,16),(13,14,15,13),(14,15,13,14),(15,13,14,15),(3,4,5,6,7,9,10,11,2,12,13,16),(3,4,5,6,7,9,10,11,2,12,13,14,15),(3,4,5,9,10,11,2,12,13,16),(3,4,5,6,7,9,11,2,12,13,14,15),(3,4,5,9,11,2,12,13,16),(3,4,5,9,10,11,2,12,13,14,15),(8,5,6,8),(6,8,5,9,10,11,2,12,13,14,15),(6,8,5,9,10,11,2,12,13,16),(6,8,5,9,11,2,12,13,14,15),(6,8,5,9,11,2,12,13,16),(8,5,6,7,9,10,11,2,12,13,14,15),(8,5,6,7,9,10,11,2,12,13,15),(8,5,6,7,9,11,2,12,13,14,15),(8,5,6,7,9,11,2,12,13,15),(2,3,4,5,6,7,9,10,11,2),(2,3,4,5,6,8,9,11,2),(2,3,4,5,9,10,11,2)(2,3,4,5,9,11,2}

(e)[1,2,3,4,5,6,8,5,6,7,9,10,11,2,12,13,14,15,13,16]

(f)[1,2,3,4,5,6,8,5,6,7,9,10,11,2,12,13,14,15,13,16],[1,2,3,4,5,9,11,2,12,13,16]

二:基于JunitEclemma实现

技术分享图片

技术分享图片

技术分享图片

 

技术分享图片

 

以上是关于软测hw3的主要内容,如果未能解决你的问题,请参考以下文章

软件测试主路径覆盖hw3

软件测试技术 hw3

Software Testing -- HW3

[ST2017] Hw3: Prime Path

hw3

hw3