首页 > 其他 > 详细

2018软件测试_Homework 2

时间:2018-03-11 21:35:50      阅读:203      评论:0      收藏:0      [点我收藏+]

技术分享图片

作业要求很简单,就是对这两个函数进行分析,考察对于fault、error、failure的理解,具体作答如下:

  • Identify the fault

左侧findLast函数,在for循环中,i>0应改为i>=0,否则不会判断数组第一位;

右侧lastZero函数,若数组不为空且存在0,当前返回结果为数组中0所在的最小下标,即FIRST 0 in x,for循环中的判断条件应改为:

for(int i = x.length-1; i >= 0; i--)
  • If possible, identify a test case that does not execute the fault. (Reachability)

findLast:

test: x=null; y = 3

lastZero:

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

findLast:

test: x=[1, 2]; y = 2

lastZero:

test: x=[0]
  • If possible identify a test case that results in an error, but not a failure.

findLast:

test: x=[1, 2]; y = 3

lastZero:

test: x=[1, 2]

 

2018软件测试_Homework 2

原文:https://www.cnblogs.com/LKFrunning/p/8546083.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!