首页 > 其他 > 详细

软件测试第二次作业-Fault、Error、Failure

时间:2017-02-25 16:55:28      阅读:268      评论:0      收藏:0      [点我收藏+]

题目:

技术分享

技术分享

解答:

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

软件测试第二次作业-Fault、Error、Failure

原文:http://www.cnblogs.com/ideal233/p/6442075.html

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