Computers and Technology
Computers and Technology, 24.04.2020 22:19, pdipti725

Answer questions (a) through (d) for the mutant in the two methods, findVal()
and sum().
(a) If possible, find a test input that does not reach the mutant.
(b) If possible, find a test input that satisfies reachability but not infection for
the mutant.
(c) If possible, find a test input that satisfies infection, but not propagation
for the mutant.
(d) If possible, find a test input that kills mutant m.

//Effects: If numbers null throw NullPointerException
// else return LAST occurrence of val in numbers[]
// If val not in numbers[] return -1
1. public static int findVal(int numbers[], int val)
2. {
3. int findVal = -1;
4.
5. for (int i=0; i 5’.// for (int i=(0+1); i 6.
if (numbers [i] == val)
7.
findVal = i;
8. return (findVal);
9. }

//Effects: If x null throw NullPointerException
// else return the sum of the values in x
1. public static int sum(int[] x)
2. {
3. int s = 0;
4. for (int i=0; i < x. length; i++) }
5. {
6.
s = s + x[i];
6’. // s = s - x[i]; //AOR
7. }
8. return s;
9. }

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:30, Jessieeeeey
Kto rozmawia z clamentain przez krótkofalówke w the walking dead która śledzi lee w 4 epizodzie
Answers: 1
image
Computers and Technology, 24.06.2019 20:00, Cookie320
Write c++programs for the following problem: let the user enter two numbers and display which is greater. !
Answers: 1
image
Computers and Technology, 24.06.2019 21:40, Jsusussueususu
is on drugs i swear i ask a question and its not showing whats going
Answers: 2
image
Computers and Technology, 25.06.2019 01:30, 91miketaylor
The study of how to design software, solve problems such as computer security threats, or come up with better ways of handling data storage
Answers: 1
Do you know the correct answer?
Answer questions (a) through (d) for the mutant in the two methods, findVal()
and sum().

Questions in other subjects: