Find the fault and design test case

The first program:

1. The fault:

should end at 0 rather 1;

2.test x[]=[2,3,5]; y=7;

 Expected= -1;

 Actual= -1;

 

3.test x[]=[2,3,5];y=2;

Expected= 0;

 Actual= -1;

 

4. test x[]=[2,3,5];y=3;

 Expected= 1;

 Actual= 1;

The second program:

1. The fault:

 

should return the last one equal 0,rather than the first one.

 

2. test x[]=[1,2,3,4]

  Expected = -1;

  Actual = -1;

 

3. test x[]=[1,0,0]

  Expected = 2;

  Actual = 1;

 

4. test x[]=[1,0,2]

  Expected = 1;

  Actual = 1s;

posted @ 2017-03-01 12:14  程序员均均  阅读(97)  评论(0编辑  收藏  举报