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.

We would like to add a new mutator that mutates Linq queries. It should look for specific methods and replace them with their counterpart or remove them. The following methods should be mutated:

Original Mutated
Distinct()
Reverse()
OrderBy()
OrderByDescending()
SingleOrDefault() FirstOrDefault()
FirstOrDefault() SingleOrDefault()
First() Last()
Last() First()
All() Any()
Any() All()
Skip() Take()
Take() Skip()
SkipWhile() TakeWhile()
TakeWhile() SkipWhile()
Min() Max()
Max() Min()
Sum() Count()
Count() Sum()

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
richardwerkmancommented, Oct 12, 2018

Well, I don’t think we can detect Linq Syntax, since it’s not an actual C# kind. We can only detect the name of methods. In this case I think it’s oke to assume that every method with the IdentifierName “All” is an Linq all method. The only way to know that for sure is by reading the semantic model.

We chose not to create an semantic model for each file since this is an expensive operation. We chose to mutate everything we can, while trusting the RollBack mechanism to resolve our “broken mutations”.

So if your mutator wrongly mutates an “All()” invocation, we can trust Stryker to handle this.

I hope this helps!

0reactions
rouke-broersmacommented, Oct 19, 2018

Implemented by #185

Read more comments on GitHub >

github_iconTop Results From Across the Web

Linq mutator proposal · Issue #166
I'm thinking about a cool new mutator for C#. There are a lot of LinQ methods that return the same interface, this makes...
Read more >
Exciting new features for Stryker.NET
It seems we missed some Linq methods when initially creating the Linq mutator. The following mutations have been added to the Linq mutator....
Read more >
QueryMutator 1.3.1
A lightweight query mapping library, QueryMutator provides Queryable, Enumerable and Object extensions for automapping objects and mapping ...
Read more >
Perform mutable updates in LINQ query?
I have a LINQ query where I want to return modified objects. ... I think Eric Lippert wrote elsewhere on this site to...
Read more >
Language Integrated Query - Wikipedia
Language Integrated Query (LINQ, pronounced "link") is a Microsoft . ... contained in the classes and generates accessors and mutators for these fields....
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