Given the below code and 2 mutants (X and Y) answer the following questions for
ID: 654924 • Letter: G
Question
Given the below code and 2 mutants (X and Y) answer the following questions foreach mutant.
int max (int A, int B)
{
int maxVal;
maxVal = B; /* X */
if (B < A)
{
maxVal = A; /* Y */
}
return (maxVal);
}
Mutants X and Y:
(X) maxVal = B; // Original
maxVal = A; // Mutant X
(Y) maxVal = A; // Original
maxVal = B; // Mutant Y
(a) If possible, find values for integers A and B where cannot reach the mutant. If there are no such values, explain why. (Answer for each mutant X and Y)
(b) If possible, find values for integers A and B where can satisfy reachability but not infection for the mutant. If there are no such values, explain why. (Answer for each mutant X and Y)
Explanation / Answer
(a)
the values of A & B should be equal where mutant cannot be reached i.e., A=10 & B=10
(b)
the values of A & B should not be equal where either mutant can be reached i.e., A=10 & B=12
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.