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.

Class-level exclusions and mutation options

See original GitHub issue

Is your feature request related to a problem? Please describe. We have a set of helper functions in an library we reference related to argument validation, each which takes an optional message that will eventually become the exception message. It’s quite frustrating that Stryker marks the strings as survived mutants as we don’t check the messages in our tests (and it would be an undertaking to do so)

Requires.NotNull(arg1, nameof(arg1), "optional message");
Requires.Argument(arg2 > 0, nameof(arg2), "optional message");
Requires.Range(arg3, 0, 5, nameof(arg3), inclusive: true, "optional msg");

These methods exist in pretty much all of our public (and some internal) API so it’s lot of noise to have to deal with.

Describe the solution you’d like Ideally I’d like a way to exclude an entire class (rather than just the method names) since in this case the majority of checks are null tests.

Another option would be a way to tweak mutations at the class/method level (ie. don’t apply string mutations). As you can see in the examples above, I don’t really care about the string mutations but If I could, I’d probably want to keep the < mutation on the Argument method and the false mutation on the Range method… but really I’d settle (sigh) for excluding the entire class altogether if only to remove the noise of the string mutants.

Describe alternatives you’ve considered The class in question only has a handful of methods, so I could just list them out in the config file, but I’d have to do so for every project. If I add new methods I’d have to make sure to update everything. The names are fairly generic in some cases (we have an IsDefined for enums) so there’s still some chance of some conflicts using method name only.

Another option would be to disable string mutations altogether. We’ve not explored that option yet, but based on what we’ve been seeing so far this may be a viable alternative.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:18 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
psfinakicommented, Aug 3, 2021

Alright, thanks for calming me down 😃

1reaction
rouke-broersmacommented, Aug 3, 2021

@psfinaki I don’t mind when you ask for a release and it’s not a lot of effort. It’s more that historically we haven’t released every commit unless it had been some time in between or there is a specific need such as in this case. So I often forget to release 🤷‍♂️. I’m happy you remind us to release stuff no worries.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mutations in Apollo Kotlin
Mutations are GraphQL operations that modify back-end data. As a convention in GraphQL, queries are read operations and mutations are write operations.
Read more >
Mutations - Hot Chocolate
If we want to split up our mutation type into multiple classes, we can do so using type extensions. Learn more about extending...
Read more >
graphql-java-codegen/docs/codegen-options.md at main
Specifies whether model classes should be generated for type Query , type Subscription , type Mutation .
Read more >
issues with GraphQLInterface, and object input types for ...
I'm having three separate issues, and not sure if they're bugs or (more likely) a misunderstanding by me of how to use the...
Read more >
FAQ
These tests can be excluded using the excludedClasses option. The most effective way to use mutation ... PIT found no classes to mutate...
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