Linq mutator
See original GitHub issueWe 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:
- Created 5 years ago
- Comments:8 (8 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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!
Implemented by #185