question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some statements break Stryker.NET

See original GitHub issue

The issue

The following statement breaks Stryker:

string someQuery = "test";
new Uri(new Uri(""), "/API?" + someQuery);

The reason is that changing the + to an - will not cause one but two compile errors.

  1. cannot convert from 'System.Uri' to 'string'
  2. Operator '-' cannot be applied to operands of type 'string' and 'string'

During the rollback stage Stryker will try to rollback both errors. It will find the mutation that causes this twice and will try to remove that node twice. The first time is succesful, the second time the node is already removed and will throw a null reference exception. This crashes Stryker.

Fix

https://github.com/stryker-mutator/stryker-net/blob/f5395ae6bdeb38b4aadc84dbaac9caee23a4e699/src/Stryker.Core/Stryker.Core/Compiling/RollbackProcess.cs#L91 The mutation made in the causing statement exists twice in the brokenMutations Collection. Somehow we have to make sure the list cannot contain a mutation twice.

This will fix the bug.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
B1tF8ercommented, Oct 4, 2018

I am working on this

1reaction
B1tF8ercommented, Oct 4, 2018

Can I do this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stryker Randomly Reports NoCoverage for all mutants #1648
Describe the bug Stryker randomly reports NoCoverage for all non-excluded mutants. When running against multiple projects (individually) I ...
Read more >
Announcing Stryker.NET 1.0
We're proud to announce the first major release of Stryker.NET: 1.0. It comes with exciting new features and an overhaul of how you...
Read more >
Configuration | Stryker Mutator
Stryker aborts a unit testrun for a mutant as soon as one test fails because this is enough to confirm the mutant is...
Read more >
Mutation testing: first steps with Stryker-Mutator .Net
If the tests succeed, the mutant is a survivor, and this means your test base is imperfect. Conversely, if at least one test...
Read more >
Stryker Mutation test fails when debug statement is added ...
Stryker fails to run any test cases under a xunit test class when debug statement is included in the code block. I have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found