Software testing hw2 -- designing the test case of two programs

 

1、          The first program’s fault is the end condition of for loop. It’s not i > 0, it should i >= 0; Because the index of the array is starting from 0.

The second program’s fault is the start condition of for loop. Because it is looking for the last one, so it should be from the back to find. So the for loop should be  for(int i=x.length-1;i>=0;i--)

2、          To identity a test case that does not execute the fault

①    the first program test case

x=[ ], y=2

②    the, second program test case

x=[ ]

When x is an empty array, both of two programs will not enter the loop. So they do not execute the fault

3、          To identity a test case that executes the fault, but does not result in an error fault.

①     The first program test case

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

②     The second program test case

x=[1.0,1]

This way they will go into the loop but they will not result in an error.

4、          To identity a test case that results in an error fault, but not a failure.

①    The first program test case

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

②     The second program test case

x=[1,1,1]

This is because the value of the search does not exist, so the expected results and the actual results are the same.

转载于:https://www.cnblogs.com/zjwjerome/p/6445034.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值