日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Software Testing Homework03:

發(fā)布時(shí)間:2025/4/16 编程问答 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Software Testing Homework03: 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

1.回答書上63-64printPrimes()問題a-d

a:本題控制流圖如下圖1所示

為查看方便,利用圖2進(jìn)行答題

? ??????????????????

?????????????????????????????????? 圖1???????????????????????? 圖2

b:

??我們注意到代碼第十行有int [] primes = new int [MAXPRIMES]

若在程序中設(shè)置MAXPRIMES = 4,那么當(dāng)運(yùn)行t1時(shí)不會出錯(cuò)誤,但是在運(yùn)行t2時(shí)會出現(xiàn)數(shù)組越界錯(cuò)。

c:

?????設(shè)計(jì)一個(gè)不經(jīng)過while循環(huán)體的測試用例

?????t3 = n=10

d:

Node coverage:

??TR = {1,2,3,4,5,6,7,8,9,10,11,12,13,14}

??Test Paths: [1,2,3,4,5,7,4,6,8,9,10,2,11,12,13,12,14]

Edge coverage:

??TR= {[1,2],[2,3],[2,11],[3,4],[4,5],[4,6],[5,6],[5,7],[6,8],[7,4],[8,9][8,10],

??????[9,10],[10,2],[11,12],[12,13],[12,14],[13,12]}

??Test Paths: i.[1,2,3,4,5,7,4,6,8,9,10,2,11,12,13,12,14]

???????????ii.[1,2,3,4,5,6,8,10,2,11,12,14]

Prime path coverage:

??TR={ [12,13,12],[13,12,13],[4,5,7,4],[5,7,4,5],[7,4,5,7],[2,3,4,6,8,10,2],

??????[3,4,6,8,10,2,3],[4,6,8,10,2,3,4],[6,8,10,2,3,4,6],[8,10,2,3,4,6,8],

??????[10,2,3,4,6,8,10],[2,3,4,5,6,8,10,2],[2,3,4,6,8,9,10,2],

??????[3,4,5,6,8,10,2,3],[3,4,6,8,9,10,2,3],[4,5,6,8,10,2,3,4],

??????[4,6,8,9,10,2,3,4],[5,6,8,10,2,3,4,5],[6,8,9,10,2,3,4,6],

??????[6,8,10,2,3,4,5,6],[8,9,10,2,3,4,6,8],[8,10,2,3,4,5,6,8],

??????[9,10,2,3,4,6,8,9],[10,2,3,4,5,6,8,10],[10,2,3,4,6,8,9,10],

??????[2,3,4,5,6,8,9,10,2],[3,4,5,6,8,9,10,2,3],[4,5,6,8,9,10,2,3,4],

??????[5,6,8,9,10,2,3,4,5],[6,8,9,10,2,3,4,5,6],[8,9,10,2,3,4,5,6,8],

??????[9,10,2,3,4,5,6,8,9],[10,2,3,4,5,6,8,9,10],

??????[1,2,11,12,13],[1,2,11,12,14],[1,2,3,4,5,7],[1,2,3,4,6,8,10],

??????[1,2,3,4,5,6,8,10],[1,2,3,4,6,8,9,10],[5,7,4,6,8,10,2,3],

??????[6,8,10,2,3,4,5,7],[7,4,5,6,8,10,2,3],[1,2,3,4,5,6,8,9,10],

??????[3,4,6,8,10,2,11,12,13],[3,4,6,8,10,2,11,12,14],[5,7,4,6,8,9,10,2,3]

??????[6,8,9,10,2,3,4,5,7],[7,4,5,6,8,9,10,2,3],[3,4,5,6,8,10,2,11,12,14],

??????[3,4,5,6,8,10,2,11,12,13],[3,4,6,8,9,10,2,11,12,13],

??????[3,4,6,8,9,10,2,11,12,14],[5,7,4,6,8,10,2,11,12,13],

??????[5,7,4,6,8,10,2,11,12,14],[7,4,5,6,8,10,2,11,12,13],

??????[7,4,5,6,8,10,2,11,12,14],[3,4,5,6,8,9,10,2,11,12,13],

??????[3,4,5,6,8,9,10,2,11,12,14],[5,7,4,6,8,9,10,2,11,12,13],

??????[5,7,4,6,8,9,10,2,11,12,14],[7,4,5,6,8,9,10,2,11,12,13],

??????[7,4,5,6,8,9,10,2,11,12,14]

?????}

2.根據(jù)上題編寫一個(gè)主路徑覆蓋測試

??我對于書上的源程序上做了修改,測試代碼如下:

??測試結(jié)果如下圖:

?

此次作業(yè)代碼已上傳至github:

https://github.com/humengdne/ST-Homeworks/tree/master/HW03

?

英文版:

1. Answering printPrimes () questions a-d on book pages 63-64 :

A: The control flow chart is shown in Figure 1 below

To view conveniently, use Figure 2 to answer:

?

??????????????????????? ? ? ? ? ?? Figure 1????????????????????????????????????????????????????????????? Figure 2

b:

??We noted that int [] primes = new int [MAXPRIMES] at the 10th?line at code.

If I set MAXPRIMES = 4, there will be a failure in t2, which is caused by Array crosses. But the failure will not appear when t1 is running.

c:

????Design a test case without going through a while loop body

?????t3 = n=10

d:

Node coverage:

??TR = {1,2,3,4,5,6,7,8,9,10,11,12,13,14}

??Test Paths: [1,2,3,4,5,7,4,6,8,9,10,2,11,12,13,12,14]

?

Edge coverage:

??TR= {[1,2],[2,3],[2,11],[3,4],[4,5],[4,6],[5,6],[5,7],[6,8],[7,4],[8,9][8,10],

??????[9,10],[10,2],[11,12],[12,13],[12,14],[13,12]}

??Test Paths: i.[1,2,3,4,5,7,4,6,8,9,10,2,11,12,13,12,14]

???????????ii.[1,2,3,4,5,6,8,10,2,11,12,14]

Prime path coverage:

??TR={ [12,13,12],[13,12,13],[4,5,7,4],[5,7,4,5],[7,4,5,7],[2,3,4,6,8,10,2],

??????[3,4,6,8,10,2,3],[4,6,8,10,2,3,4],[6,8,10,2,3,4,6],[8,10,2,3,4,6,8],

??????[10,2,3,4,6,8,10],[2,3,4,5,6,8,10,2],[2,3,4,6,8,9,10,2],

??????[3,4,5,6,8,10,2,3],[3,4,6,8,9,10,2,3],[4,5,6,8,10,2,3,4],

??????[4,6,8,9,10,2,3,4],[5,6,8,10,2,3,4,5],[6,8,9,10,2,3,4,6],

??????[6,8,10,2,3,4,5,6],[8,9,10,2,3,4,6,8],[8,10,2,3,4,5,6,8],

??????[9,10,2,3,4,6,8,9],[10,2,3,4,5,6,8,10],[10,2,3,4,6,8,9,10],

??????[2,3,4,5,6,8,9,10,2],[3,4,5,6,8,9,10,2,3],[4,5,6,8,9,10,2,3,4],

??????[5,6,8,9,10,2,3,4,5],[6,8,9,10,2,3,4,5,6],[8,9,10,2,3,4,5,6,8],

??????[9,10,2,3,4,5,6,8,9],[10,2,3,4,5,6,8,9,10],

??????[1,2,11,12,13],[1,2,11,12,14],[1,2,3,4,5,7],[1,2,3,4,6,8,10],

??????[1,2,3,4,5,6,8,10],[1,2,3,4,6,8,9,10],[5,7,4,6,8,10,2,3],

??????[6,8,10,2,3,4,5,7],[7,4,5,6,8,10,2,3],[1,2,3,4,5,6,8,9,10],

??????[3,4,6,8,10,2,11,12,13],[3,4,6,8,10,2,11,12,14],[5,7,4,6,8,9,10,2,3]

??????[6,8,9,10,2,3,4,5,7],[7,4,5,6,8,9,10,2,3],[3,4,5,6,8,10,2,11,12,14],

??????[3,4,5,6,8,10,2,11,12,13],[3,4,6,8,9,10,2,11,12,13],

??????[3,4,6,8,9,10,2,11,12,14],[5,7,4,6,8,10,2,11,12,13],

??????[5,7,4,6,8,10,2,11,12,14],[7,4,5,6,8,10,2,11,12,13],

??????[7,4,5,6,8,10,2,11,12,14],[3,4,5,6,8,9,10,2,11,12,13],

??????[3,4,5,6,8,9,10,2,11,12,14],[5,7,4,6,8,9,10,2,11,12,13],

??????[5,7,4,6,8,9,10,2,11,12,14],[7,4,5,6,8,9,10,2,11,12,13],

??????[7,4,5,6,8,9,10,2,11,12,14]

?????}

2.According to the printPrimes(), design a test for Prime paths Coverage.

??I modified the source code in the book, and the test code as follows:

The test result as follows:

???

?

轉(zhuǎn)載于:https://www.cnblogs.com/humeng96/p/6546939.html

總結(jié)

以上是生活随笔為你收集整理的Software Testing Homework03:的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。