Skip to content

Multiply change into Divide #1856

Closed Answered by dupdob
AlbertoMonteiro asked this question in Q&A
Discussion options

You must be logged in to vote

Good question.

Answer

Your question is more theoretical than practical: it does not make sense to test this mutant: if there is no change in the program behavior, this is not an actual mutant, just a source code change.

But, from a practical standpoint, it is normal and expected: Stryker.Net tests every source code mutation it generates. There is a filtering logic that removes mutations that are duplicates at the source code level, but there is no attempt to detect semantic duplicates.

How to avoid ?

When you have mutations that do not change the program behavior, this is a hint the code may be simpler. Here you could use:

condition ? request.Amount.Value : -request.Amount.Value

Why Stryk…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@AlbertoMonteiro
Comment options

@dupdob
Comment options

dupdob Mar 12, 2022
Collaborator

Answer selected by AlbertoMonteiro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants