问题:给定两段代码,设计fault,error,failure的测试用例. fault:即引起错误的原因,类似病因. error:类似疾病引起的内部结果. failure:类似疾病引起的症状. 代码1: public int findLast (int[] x, int y) {//Effects: If x==null throw NullPointerException// else return the index of the last element// in x that equal…
Software Testing 3014218128 牛菲菲 Below are two faulty programs. Each includes a test case that results in failure.Answer the following questions (in the next slide) about each program. 1. public int findLast (int[] x, int y) {//Effects: If x==null thr…
给出的题目如下: 我的解答如下: For program 1:1. where i > 0 is the fault , it should be changed to i>= 0 to avoid x is just one element situation. 2.x[] ={} or x[]={n}(n is equal to any numb),for example x[] ={1}; //test: x[] = {};y =2 //expected = NullPointerExc…