## Exercise doubts - Ex8

pg73dugu
Neuling
Beiträge: 8
Registriert: 23. Okt 2015 01:11

### Exercise doubts - Ex8

How many mutants does SSDL and STRP generate for function foo in Listing 1?
According to me there are 12 Mutants by both SSDL ans STRP. Could anyone please share the correct answer.

1 int foo(int p1, int p2, int p3)
2 {
3 if (p1 > p2 && p2 >= p3)
4 {
5 p2 = p2 - p3;
6 if (p1 <= p3)
7 return 0xDEFEC7;
8 }
9 if (p3 % 2 == 0)
10 p3--;
11 p3 += 0;
12 return p3;
13 }

M1: 3,4,5,6,7,8,9,10,11,12
M2: 5
M3: 7
M4: 10
M5: 11
M6 :12
M7: 9,10
M8: 6,7
M9: 4,5,6,7,8
M10: 3,4,5,6,7,8
M11: 3,4,5,6,7,8,9,10
M12: 3,4,5,6,7,8,9,10,11
Zuletzt geändert von pg73dugu am 18. Aug 2016 17:18, insgesamt 2-mal geändert.

Stefan Winter
Mausschubser
Beiträge: 57
Registriert: 18. Sep 2009 13:37

### Re: Exercise doubts - Ex8

Hello,

here are two hints:
• SSDL and STRP generate the same number of mutants.
• The given function definition comprises less than 12 statements.
HTH,
Stefan

pg73dugu
Neuling
Beiträge: 8
Registriert: 23. Okt 2015 01:11

### Re: Exercise doubts - Ex8

Hello Stefan,
I have Included Mutants in my original statement. Is my understanding correct ?

Stefan Winter
Mausschubser
Beiträge: 57
Registriert: 18. Sep 2009 13:37

### Re: Exercise doubts - Ex8

Hello,

Next hint:
• One S capital letter in SSDL and STRP stands for "statement".
Besides that, please not that we usually specify the numbers that remain in the mutants.

Cheers,
Stefan