Homework2

软件测试第二次作业

 

Q1:Identify the fault

Case1’s fault:未能检测到x[0]是否与y相等。

Case2’s fault:题目要求找到最后一个0,return返回值后该函数会立刻结束,从头搜索找到的是第一个。因此该从i=x.length开始向前搜索到x=0。

Q2:If possible, identify a test case that does not execute the fault. (Reachability)

Case1:不存在可以避免这个fault的非空test集合

Case2:同样不存在可以避免这个fault的非空test集合

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

Case1:x=[2,3,5], y=5  Expected=1  Actual=1

Case2:x=[1,1,1]  Expected=-1  Actual=-1

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

Case1:x=[2,3,5], y=1  Expected=-1  Actual=-1

Case2:x=[1,0,1]  Expected=1  Actual=1

 

over

posted @ 2018-03-13 21:10  Light小姐姐  阅读(88)  评论(0)    收藏  举报