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

Count syntax errors caused by a mutatan as a failure of a mutant #1571

Merged
merged 1 commit into from Sep 11, 2021

Conversation

sanmai
Copy link
Member

@sanmai sanmai commented Sep 11, 2021

Fixes #1569, related to #1555

  1. Suppose Infections introduces a change to make a method return string instead of a float. Engineer adds strict return type to the method, killing the mutant: your ordinary defensive programming. We count this mutant as killed, giving a bump to the MSI.
  2. Suppose Infections introduces a different change, making a method fail with a syntax error. Currently we count this error as something else, as escaped mutant in terms of MSI. How can that be right?

Let's consider what are the options we're giving. How can an engineer fix this problem? Their tests are all right, it's just Infection broke their program to produce an unrecoverable error. Why should they be penalized with a lowered MSI?

It appears to me this is very unjust. If Infection causes a type error, or any error in principle, that's not what you can fix writing a better test. That's not something that leads to better tests. That's not something that makes people change their tests for the better. I hope we can agree on this.

@sanmai sanmai enabled auto-merge (squash) September 11, 2021 14:45
@sanmai sanmai added the Bugfix label Sep 11, 2021
Copy link
Member

@maks-rafalko maks-rafalko left a comment

Choose a reason for hiding this comment

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

Let's target 0.25 so we can faster release it, as 0.25.1

@sanmai sanmai merged commit 86e423c into infection:master Sep 11, 2021
@sanmai sanmai deleted the pr/2021-09/fix-1569 branch September 12, 2021 00:17
@sanmai
Copy link
Member Author

sanmai commented Sep 12, 2021

0.25 is three commits behind master, I think you should be able to forward it to the master and release:

$git checkout 0.25
$ git merge master
Updating 77b684ad..854bc7f4
Fast-forward
 .github/workflows/mt-annotations.yaml                                       |  2 +-
 src/Metrics/Calculator.php                                                  |  2 +-
 tests/phpunit/Logger/JsonLoggerTest.php                                     |  4 ++--
 tests/phpunit/Logger/PerMutatorLoggerTest.php                               |  4 ++--
 tests/phpunit/Metrics/CalculatorTest.php                                    |  4 ++--
 tests/phpunit/TestFramework/Coverage/JUnit/TestLocationBucketSorterTest.php | 25 ++++++++++++++++++++++++-
 6 files changed, 32 insertions(+), 9 deletions(-)

@maks-rafalko
Copy link
Member

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

Successfully merging this pull request may close these issues.

Unexpected "syntax errors were encountered" after updating to 0.25.0
3 participants