SOFTWARE TESTING HW02
2017-03-01 21:33 William96 阅读(195) 评论(0) 收藏 举报

Program01:
1.fault: i>0 没有判断i=0时的情况以及不能返回有两个都和y匹配的索引值;
2.a test case that does not execute the fault.
test:x=[],y=2,exceped=NullPointException,result=NullPointException;
3.a test case that executes the fault, butdoes not result in an error state.
test:x=[1,2,3],y=2,exceped=1,result=1;
4.a test case that rresults in an error,but not a failure.
test:x=[3,2,1],y=0,excepted=-1,result=-1;
Program02:
1.fault: i<x.length;i++ 应该反向比较,才能返回最后出现的x;
2.a test case that does not execute the fault.
test:x=[],exceped=NullPointException,result=NullPointException;
3.a test case that executes the fault, butdoes not result in an error state.
test:x=[0,2,3],exceped=0,result=0;
4.a test case that rresults in an error,but not a failure.
test:x=[3,2,1],excepted=-1,result=-1;
浙公网安备 33010602011771号