Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignored methods fail to exclude mutants within nested method calls or expressions #2964

Open
chinchala opened this issue Jun 12, 2024 · 0 comments
Labels
Area: Mutating 🐛 Bug Something isn't working Priority: Medium Issues that have a workaround or but should be fixed

Comments

@chinchala
Copy link

Describe the bug
The ignore-methods configuration feature is not effectively excluding specified mutants within nested method calls or expressions. Despite specifying certain methods to be ignored, mutants within nested contexts are still being generated, leading to unexpected mutation testing results.

Example:

"stryker-config": {
    "ignore-methods": ["LogInformation"]
}
logger.LogInformation("some text"); //all mutants ignored
logger.LogInformation(GetSomeText(true)); // mutant survived: logger.LogInformation(GetSomeText(false));
logger.LogInformation(logSensitiveData ? sensitive : baseRequest); //mutant survived: logger.LogInformation(!(logSensitiveData ) ? sensitive : baseRequest);

Expected behavior
Mutants within nested method calls or expressions, where the outer method is specified in the ignore-methods configuration, should be ignored.
Expected behavior for provided example:

logger.LogInformation("some text"); //all mutants ignored
logger.LogInformation(GetSomeText(true)); //all mutants should be ignored
logger.LogInformation(logSensitiveData ? sensitive : baseRequest); //all mutants should be ignored

Desktop (please complete the following information):

  • OS: mac os sonoma
  • Type of project: asp.net mvc
  • Framework Version: .net 8
  • Stryker Version: 4.0.6
@chinchala chinchala added the 🐛 Bug Something isn't working label Jun 12, 2024
@dupdob dupdob added Area: Mutating Priority: Medium Issues that have a workaround or but should be fixed labels Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Mutating 🐛 Bug Something isn't working Priority: Medium Issues that have a workaround or but should be fixed
Projects
None yet
Development

No branches or pull requests

2 participants