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

Answer the following question using the program and list of mutants 1 int triang

ID: 3827954 • Letter: A

Question


Answer the following question using the program and list of mutants 1 int triangle (int a, int b, int c) { 2 if (a a)) { return 4; //invalid } if (a == b && b == c) { return 1; // equilateral } if(a == b || b == c || a == c ) { return 2; // isosceles } return 3; // scalene } List of mutant Mutant 1 (Line number 2): if (b a)) Mutant 4 (Line number 11): if (a == b || b == c || a > = c) Test cases {(0, 1, 1), (1, 1, 3), (2, 2, 2), (2, 2, 3), (2, 3, 4)} Compute mutation score Design more test cases to kill all mutants above

Explanation / Answer

[1]
Test Case (0,1,1)

Mutant 1 : T||F||F --> T
Mutant 2 : F && F && T --> F
Mutant 3 : F||T||F --> T

[2]

Test Case (1,1,3)

Mutant 1 : F||F||F --> F
Mutant 2 : F && T && T --> F
Mutant 3 : T||F||F --> T

[3]

Test Case (2,2,2)

Mutant 1 : F||F||F --> F
Mutant 2 : T && T && T --> T
Mutant 3 : T||T||T --> T


[4]

Test Case (2,2,3)

Mutant 1 : F||F||F --> F
Mutant 2 : T && T && T --> T
Mutant 3 : T||F||F --> T

[5]

Test Case (2,3,4)

Mutant 1 : F||F||F --> F
Mutant 2 : T && T && T --> T
Mutant 3 : F||F||F --> F

-------------------------------------------------------------------------
Part 2

TestCase(4,1,2)
Mutant 1 : F||F||F --> F
Mutant 2 : T && T && F --> F
Mutant 3 : F||F||F --> F

TestCase(5,2,2)

Mutant 1 : F||F||F --> F
Mutant 2 : T && T && F --> F
Mutant 3 : F||T||F --> T