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

Naming scheme + Adjusted mutation score used by mutation levels #2995

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

dvcopae
Copy link

@dvcopae dvcopae commented Feb 1, 2024

Contains:

  • documentation about the namings of mutation operators
  • computation for the adjusted (absolute) mutation score

The status IGNORED_BY_LEVEL_STATUS is introduced in the mutation levels PR from StrykerJS, so that one needs to be merged first for this functionality to be enabled.

@dvcopae dvcopae changed the title Documentation + Adjusted mutation score for mutation levels Naming scheme + Adjusted mutation score for mutation levels Feb 1, 2024
@dvcopae dvcopae changed the title Naming scheme + Adjusted mutation score for mutation levels Naming scheme + Adjusted mutation score used by mutation levels Feb 1, 2024
| ------------------------------------------ | -------------------------------------- | --------------------- |
| FilledStringLiteralToEmptyReplacement | `"foo"` (filled string) | `""` (empty string) |
| EmptyStringLiteralToFilledReplacement | `""` (empty string) | `"Stryker was here!"` |
| FilledInterpolatedStringToEmptyReplacement | `s"foo ${bar}"` (string interpolation) | `s""` ¹ |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor thing, but as far as I'm concerned, this can also be FilledStringLiteralToEmptyReplacement. I don't think Stryker-JS, for example, has a difference between "" and ``

Copy link

bundlemon bot commented Feb 2, 2024

BundleMon (elements)

Files updated (3)
Status Path Size Limits
index.js
266.39KB (+205B +0.08%) -
index.cjs
195.07KB (+159B +0.08%) -
mutation-test-elements.js
195.08KB (+159B +0.08%) -

Total files change +523B +0.08%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

| SubtractionAssignmentNegation | `-=` | `+=` |
| MultiplicationAssignmentNegation | `*=` | `/=` |
| DivisionAssignmentNegation | `/=` | `*=` |
| RemainderAssignmentToMultiplicationReplacement | `%=` | `*=` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| RemainderAssignmentToMultiplicationReplacement | `%=` | `*=` |
| RemainderAssignmentToMultiplicationAssignmentReplacement | `%=` | `*=` |

| RemainderAssignmentToMultiplicationReplacement | `%=` | `*=` |
| LeftShiftAssignmentNegation | `<<=` | `>>=` |
| RightShiftAssignmentNegation | `>>=` | `<<=` |
| BitwiseAndAssignmentToBitwiseOrReplacement | `&=` | <code>&#124;=</code> |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| BitwiseAndAssignmentToBitwiseOrReplacement | `&=` | <code>&#124;=</code> |
| BitwiseAndAssignmentToBitwiseOrAssignmentReplacement | `&=` | <code>&#124;=</code> |

| LeftShiftAssignmentNegation | `<<=` | `>>=` |
| RightShiftAssignmentNegation | `>>=` | `<<=` |
| BitwiseAndAssignmentToBitwiseOrReplacement | `&=` | <code>&#124;=</code> |
| BitwiseOrAssignmentToBitwiseAndReplacement | <code>&#124;=</code> | `&=` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| BitwiseOrAssignmentToBitwiseAndReplacement | <code>&#124;=</code> | `&=` |
| BitwiseOrAssignmentToBitwiseAndAssignmentReplacement | <code>&#124;=</code> | `&=` |

| RightShiftAssignmentNegation | `>>=` | `<<=` |
| BitwiseAndAssignmentToBitwiseOrReplacement | `&=` | <code>&#124;=</code> |
| BitwiseOrAssignmentToBitwiseAndReplacement | <code>&#124;=</code> | `&=` |
| NullishCoalescingOperatorToLogicalAndAssignmentReplacement | `??=` | `&&=`¹ |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| NullishCoalescingOperatorToLogicalAndAssignmentReplacement | `??=` | `&&=`¹ |
| NullishCoalescingAssignmentToLogicalAndAssignmentReplacement | `??=` | `&&=`¹ |

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rouke-broersma would you agree on this name? Or should it be NullCoalescingAssingmentToLogicalAndAssignmentReplacement?

Comment on lines +113 to +122
| Mutant operator | Original | Mutated |
| -------------------------------------- | ---------------------------------------------------------- | ------------------------------------------- |
| ForLoopConditionToFalseReplacement | `for (var i = 0; i < 10; i++) { }` | `for (var i = 0; false; i++) { }` ¹ |
| WhileLoopConditionToFalseReplacement | `while (a > b) { }` | `while (false) { }` |
| DoWhileLoopConditionToFalseReplacement | `do { } while (a > b);` | `do { } while (false);` |
| IfConditionToTrueReplacement | `if (a > b) { }` | `if (true) { }` |
| IfConditionToFalseReplacement | `if (a > b) { }` | `if (false) { }` |
| BooleanExpressionToTrueReplacement | `var x = a > b ? 1 : 2;` | `var x = true ? 1 : 2;` ¹ |
| BooleanExpressionToFalseReplacement | `var x = a > b ? 1 : 2;` | `var x = false ? 1 : 2;` ¹ |
| SwitchStatementBodyRemoval | `switch(x) { case 1: doSomething(); default: default(); }` | `switch(x) { case 1: default: default(); }` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove this group, as mutants in this group should be merged in others.

Old name New name
ForLoopConditionToFalseReplacement LessThanExpressionToFalseReplacement
WhileLoopConditionToFalseReplacement same
DoWhileLoopConditionToFalseReplacement GreaterThanExpressionToFalseReplacement
IfConditionToTrueReplacement GreaterThanExpressionToTrueReplacement
IfConditionToFalseReplacement Sane
BooleanExpressionToTrueReplacement Same
BooleanExpressionToFalseReplacement Same
SwitchStatementBodyRemoval BlockStatementRemoval

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants