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

Add Math Mutations #2233

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions docs/supported-mutators.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ All Stryker versions support a variety of different mutators. We've aligned on a
| [String Literal](#string-literal) | ✅ | ✅ | ✅ |
| [Unary Operator](#unary-operator) | ✅ | ✅ | ❌ |
| [Update Operator](#update-operator) | ✅ | ✅ | n/a |
| [Math Methods](#math-methods) | ❌ | ✅ | ❌ |

## Arithmetic Operator

Expand Down Expand Up @@ -320,3 +321,56 @@ Strings and literals identified to a regex are mutated in the following way:
| `--a` | `++a` |

[🔝 Back to Top](#)

## Math Methods
| Original | Mutated |
| ----------------------- | ----------------------- |
| `Acos()` | `Acosh()` |
Copy link
Member

Choose a reason for hiding this comment

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

These all look like C# math functions, I don't know if for example Java has the same methods. Perhaps it's cleanest to do a similar thing to method expressions and make a C# category for math methods?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can add the categories as soon as a second language support this right? Because for now C# is the only category

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but this now reads as though this should be the implementation for any language that wants to add math methods, while that's not the case. There should at least be some indication that this is C#-specific

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

| `Acos()` | `Asin()` |
| `Acos()` | `Atan()` |
| `Acosh()` | `Acos()` |
| `Acosh()` | `Asinh()` |
| `Acosh()` | `Atanh()` |
| `Asin()` | `Asinh()` |
| `Asin()` | `Acos()` |
| `Asin()` | `Atan()` |
| `Asinh()` | `Asin()` |
| `Asinh()` | `Acosh()` |
| `Asinh()` | `Atanh()` |
| `Atan()` | `Atanh()` |
| `Atan()` | `Acos()` |
| `Atan()` | `Asin()` |
| `Atanh()` | `Atan()` |
| `Atanh()` | `Acosh()` |
| `Atanh()` | `Asinh()` |
| `BitDecrement()` | `BitIncrement()` |
| `BitIncrement()` | `BitDecrement()` |
| `Ceiling()` | `Floor()` |
| `Cos()` | `Cosh()` |
| `Cos()` | `Sin()` |
| `Cos()` | `Tan()` |
| `Cosh()` | `Cos()` |
| `Cosh()` | `Sinh()` |
| `Cosh()` | `Tanh()` |
| `Exp()` | `Log()` |
| `Floor()` | `Ceiling()` |
| `Log()` | `Exp()` |
| `Log()` | `Pow()` |
| `MaxMagnitude()` | `MinMagnitude()` |
| `MinMagnitude()` | `MaxMagnitude()` |
| `Pow()` | `Log()` |
| `ReciprocalEstimate()` | `ReciprocalSqrtEstimate()` |
| `ReciprocalSqrtEstimate()` | `ReciprocalEstimate()` |
| `ReciprocalSqrtEstimate()` | `Sqrt()` |
| `Sin()` | `Sinh()` |
| `Sin()` | `Cos()` |
| `Sin()` | `Tan()` |
| `Sinh()` | `Sin()` |
| `Sinh()` | `Cosh()` |
| `Sinh()` | `Tanh()` |
| `Tan()` | `Tanh()` |
| `Tan()` | `Cos()` |
| `Tan()` | `Sin()` |
| `Tanh()` | `Tan()` |
| `Tanh()` | `Cosh()` |
| `Tanh()` | `Sinh()` |