软件测试作业二

1.Identify the fault.

程序一:索引值i取不到0,数组中遗漏最后一个元素。

程序二:当搜索到第一个0时便返回其索引(并非最后一个0值)

2.If possible, identify a test case that does not execute the fault.

程序一:

                  Test: x = [], y = 2

程序二:

                  Test: x = []

3.If possible, identify a test case that executes the fault, but does not result in an error state.

程序一:

                  Test: x = [2, 3, 5], y = 2

程序二:

                  Test: x = [0, 1, 2]

4.If possible, identify a test case that results in an error, but not a failure.

程序一:

                  Test: x = [3, 4, 5], y = 2

程序二:

                  Test: x = [1, 2, 3]

 

 
 
posted @ 2018-03-14 23:52  张宁宁宁宁  阅读(94)  评论(0编辑  收藏  举报