软件测试课后习题
Posted 事不过三寻
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了软件测试课后习题相关的知识,希望对你有一定的参考价值。
(a)
CFG:
(b) 当MAXPRIMES的值为4的时候。t2会造成数组越界的错误。
(c) n = 1
(d) Node Coverage:
TR{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
Test Path={[1,2,3,4,5,7,9,5,6,10,12,3,13,14,15,13,16]
[1,2,3,4,5,7,8,6,10,11,12,3,13,16]}
Edge Coverage:
TR{[1,2],[2,3],[3,4],[3,13],[4,5],[5,7],[5,6],[7,9],[7,8],[9,5],[8,6],[6,10],[10,11],
[10,12],[11,12],[12,3],[13,14],[14,15],[15,13],[13,16]}
Test Path = {[1,2,3,4,5,7,9,5,6,10,12,3,13,14,15,13,16]
[1,2,3,4,5,7,8,6,10,11,12,3,13,16]}
Prime Path Coverage:
TR{[1,2,3,4,5,7,9], [1,2,3,4,5,7,8,6,10,12],[3,4,5,6,10,11,12,3]
[3,4,5,7,8,6,10,11,12,3],[3,4,5,6,10,12,3],[3,4,5,6,10,12,3]
[5,7,9,5][7,9,5,7][9,5,7,9]
[7,9,5,6,10,12,3,13,16],[7,9,5,6,10,12,3,13,14,15],[7,9,5,6,10,11,12,3,13,16],[7,9,5,6,10,11,12,3,13,14,15]
[9,5,7,8,6,10,12,3,13,16],[9,5,7,8,6,10,12,3,13,14,15],[9,5,7,8,6,10,11,12,3,13,16]
[9,5,7,8,6,10,11,12,3,13,14,15]
[1,2,3,13,16][1,2,3,13,14,15]
[13,14,15,13][14,15,12,14],[15,13,14,15][14,15,13,16]
选择其中一条主路径测试:
测试结果:
以上是关于软件测试课后习题的主要内容,如果未能解决你的问题,请参考以下文章