软件测试[2]falut error failure 的区别与理解

Fault的定义: 可能导致系统或功能失效的异常条件(Abnormal condition that can cause an element or an item tofail.),可译为“故障”
Error的定义: 计算、观察或测量值或条件,与真实、规定或理论上正确的值或条件之间的差异(Discrepancy between a computed, observed or measured value or condition and the true, specified, or theoretically correct value or condition.),可译为“错误”。Error是能够导致系统出现Failure的系统内部状态

Failure的定义:当一个系统不能执行所要求的功能时,即为Failure,可译为“失效”。(Termination of the ability of an element or an item to perform a function as required.)

 

 

下面是我们第二次作业的实例分析

Below are four faulty programs. Each includes a test case that results in failure. Answer the following questions (in the next slide) about each program.

 

对于问题1

(1)判断条件应该为i >=0;当数组的下标为0时,也要判断。

(2)要找出最后一个0的下标,应该从后往前找,for循环可以这样改for(int i=x.length-1;i>=0;i--)

问题2

(1)不执行falut代码,x为空数组

(2)x为空数组

问题3

(1)执行falut代码,但是不出现error x = [1,2,3] y=2;

(2)x=[1,1,0] 

问题4

老是我分不清error和failure的区别,这题不会做。希望老师上课可以再讲讲。

 

转载于:https://www.cnblogs.com/GSONG/p/5260122.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值