Question: Answer the following questions using the program and list of mutants int triangle(int a, int b, int c) { if (a a)){ return 4; //

Answer the following questions using the program and list of mutants

int triangle(int a, int b, int c) {

if (a<=0 || b <= 0 || c<=0){

return 4; // invalid

}

if(!(a+b > c && a + c > b && b + c > 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 mutants

Mutant 1 (line number 2): if (b <= 0) || b <= 0 || c <= 0){

Mutant 2 (line number 5): if(! (a * b > c && a + c > b && b + c > 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)}

1. Compute the mutation score.

2. Design more test cases to kil all mutants above.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!