Given the below code and 2 mutants (X and Y) answer the following questions for
ID: 654926 • 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
(c) If possible, find values for integers A and B where can satisfy infection, but not propagation for the mutant. If there are no such values, explain why. (Answer for each mutant X and Y)
(d) Provide reachability conditions, infection conditions, propagation conditions, and test case values to kill the mutant. (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.