Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote