码迷,mamicode.com
首页 > 其他好文 > 详细

Homework2_3015218130_许鹏程

时间:2018-03-14 22:06:09      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:ase   exp   div   ide   exception   exec   --   int   ++   

program 1 :

Identify the fault.
for (int i=x.length-1; i > 0; i--)
change to:
for (int i=x.length-1; i >= 0; i--)
 
If possible, identify a test case that does not execute the fault. (Reachability)
text: x=[ ]; y=2
Expected: NullPointerException
 
If possible, identify a test case that executes the fault, but does not result in an error state.
text: x=[2,3,5]; y=3
Expected= 1
 
If possible identify a test case that results in an error, but not a failure.
text: x=[2,3,5]; y=6
Expected= -1
 

program 2:

Identify the fault.
for (int i = 0; i < x.length; i++)
change to:
for (int i =x.length-1;i>=0; i--)
 
If possible, identify a test case that does not execute the fault. (Reachability)
text: x=[ ];
Expected: NullPointerException
 
If possible, identify a test case that executes the fault, but does not result in an error state.
text: x=[0,1,1];
Expected= 0
 
If possible identify a test case that results in an error, but not a failure.
text: x=[1,1,1];
Expected= -1

Homework2_3015218130_许鹏程

标签:ase   exp   div   ide   exception   exec   --   int   ++   

原文地址:https://www.cnblogs.com/picheng/p/8570130.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!