Sample in Source Code

May 20, 2014 at 8:20 PM
In my understanding should the test case Add_Mutation_Tests_Fail fails because the mutation with SUB don't kill the testcase. The original code: 3+0 = 3, the mutant with SUB 3-0 = 3 => Testcase is not killed.

But in the logs I see, that the mutant with SUB kills the testcase. Why? Please help me... THX
Coordinator
May 21, 2014 at 12:22 PM
Hi Michael

Your understand is correct. You are talking about AdditionClassUnderTestTests.Add_Mutation_Tests_Fail I believe? I see the following in the test results for this:
Rotating arithmetic operators +, -, *, / and %.
 Mutant: 0003: Add => Rem. Killed.
 Mutant: 0003: Add => Mul. Killed.
 Mutant: 0003: Add => Div. Killed.
 Mutant: 0003: Add => Sub. Survived.
Are you looking at the log for another test? The same test fixture contains other tests where the equivalent mutant is killed.

David
May 21, 2014 at 1:57 PM
I tested project NinjaTurtles.Tests.MSTest

I did the following:
  • install nUnit Test runner from the visual studio gallery, so that I'am able to run the nUnit tests in VS.
  • Right click to class ClassUnderTestTests and click Run Tests
  • All test cases passed except Add_Mutation_Tests_Fail.
Test Name:  Add_Mutation_Tests_Fail
Test Outcome:   Failed
Result Message: MutationTestFailureException was not thrown.
Result StandardOutput:  Suite of 1 tests identified for NinjaTurtles.Tests.MSTest.ClassUnderTest.Add
Rotating arithmetic operators +, -, *, / and %.
 Mutant: 0003: Add => Sub. Killed.
 Mutant: 0003: Add => Div. Killed.
 Mutant: 0003: Add => Mul. Killed.
 Mutant: 0003: Add => Rem. Killed.
Coordinator
May 21, 2014 at 6:07 PM
Can you try with the latest code Michael? I have just committed a set of changes that include supporting Visual Studio 2013 for MSTest - I suspect this is your issue. Will post again tomorrow with a fuller explanation...
May 22, 2014 at 9:32 AM
I tried it now with VS2012 and VS2013. I downloaded the source, then I restored the nuget packages, because there were build errors and then I executed the tests. But its the same behaviour, the SUB was killed.
Dec 15, 2016 at 9:40 AM
Edited Jan 3 at 6:49 AM
Thank you