Software Testing 2

answer:

1. The first fault should be for(int i = x.length-1; i >0; i++) should be changed to i>=0

  The second fault should be for (int i = 0; i < x.length; i++) should be changed to for (int i = x.length-1; i >=0; i--)

2. test: x =[]; y = 3

  test: x=[]

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

  test: x =[]

4.test: x=[2];y=3

 test: x=[1,1,0]

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324770598&siteId=291194637
Recommended