software testing HW02

Program1:
1.fault: the i>0 should be i>=0
2.test: x=null
3.test: x=[2,3,5]; y=5; Expected=2;
4.test: x=[2,3,5]; y=4; Expected=-1;

Program2:
1.fault: for(int i=0; i<x.length; i++) should be for(int i=x.length-1; i>=0; i--)
2.test: x=null
3.test: x=[0] Expected=0;
4.test: x=[0,3,5] Expected=0;

posted @ 2017-02-26 16:56  Dongpaopao  阅读(93)  评论(0)    收藏  举报