博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
软件测试第二次作业-Fault、Error、Failure
阅读量:4606 次
发布时间:2019-06-09

本文共 675 字,大约阅读时间需要 2 分钟。

题目:

解答:

Program 1:

(1) Fault: ‘for(int i=x.length-1;i>0;i--)’. It should be “i>=0”.
(2) X=[],y=2.
  Expected=NullPointerException.
  Output=NullPointerException
(3) X=[2,3,5],y=3.
  Expected=1
  Output=1
(4) X=[1,3,5],y=2.
  Expected=-1
  Output=-1

Program 2:
(1) Fault: The for-loop should be:
  for(int i=x.length-1;i>=0;i--)
(2)It’s impossible.
(3) X=[]
  Expected=NullPointerException.
  Output=NullPointerException
(4)x=[0,1,2]
  Expected=0
  Output=0

Summery:

fault - a cause of the error (mistake in coding)

error - incorrect state that may lead to failure
failure - deviation of the service from the correct service

转载于:https://www.cnblogs.com/ideal233/p/6442075.html

你可能感兴趣的文章
【PHP】Windows下配置用mail()发送邮件
查看>>
Nhibernate和EF的区别
查看>>
基于java spring框架开发部标1078视频监控平台精华文章索引
查看>>
人类简史
查看>>
java 设计模式学习
查看>>
【Python使用】使用pip安装卸载Python包(含离线安装Python包)未完成???
查看>>
一语道破项目管理知识体系五大过程组
查看>>
C# 备份、还原、拷贝远程文件夹
查看>>
在windows环境下运行compass文件出现的错误提示解决方案
查看>>
CSS常用样式--font
查看>>
恩如氏--蜗牛精华补水蚕丝面膜
查看>>
大工具-收藏
查看>>
codevs3027 线段覆盖 2
查看>>
markdown
查看>>
【leetcode】107-Binary Tree Level Order Traversal II
查看>>
Jquert data方法获取不到数据,显示为undefined。
查看>>
ssm项目中 数据库和资源的备份
查看>>
HDU5950【矩阵快速幂】
查看>>
在线C++编译器
查看>>
C#中各种serialization的比较
查看>>