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
Mutant & Mutation tweaks #1207
Mutant & Mutation tweaks #1207
Conversation
…ts() to hasTests()
@@ -110,7 +110,7 @@ public function collect(MutantExecutionResult ...$executionResults): void | |||
break; | |||
|
|||
case DetectionStatus::NOT_COVERED: | |||
$this->notCoveredByTestsCount++; | |||
$this->notExecutedByTestsCount++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm -1 on this renaming
- it's clear what
covered
means, I don't think there is any confusion in "coverage notion" - now it's consfusing why the property is named
notExecutedByTestsCount
, but the detection status isNOT_COVERED
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's clear what covered means,
It's not, because it is not covered. The line code coverage only guarantees that a line is executed by a given test, it does not mean this test covers this line.
Also there was a discussion recently with the other mutation testing tools about an alternative to the kill/escape vocabulary and the resounding candidate was covered/uncovered which is going to be even more confusing if we keep those words with the line coverage
I totally agree with you about the detection status, I would like to change it, but that requires a bit more refactoring affecting the UI as well hence I left it alone for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not, because it is not covered. The line code coverage only guarantees that a line is executed by a given test, it does not mean this test covers this line.
I don't agree. I know the difference between types of coverage, and PHPUnit has line coverage, which exactly means that line is covered as soon as any of the opcode is executed.
So from PHPUnit point of view - line is covered. And we use only line coverage in PHP
@@ -150,16 +150,15 @@ public function getMutatedNode(): MutatedNode | |||
return $this->mutatedNode; | |||
} | |||
|
|||
// TODO: hasTest()? | |||
public function isCoveredByTest(): bool | |||
public function hasTests(): bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
Closed in favour of #1209 |
I don't think there is a need to keep a duplicated method hence the removal of:
Mutant::isCoveredByTests()
Mutant::getTests()
I also propose to rename
Mutation::isCoveredByTests()
tohasTests()
or alternativelyisExecutedByTests()
to avoid the "coverage" notion confusion.Mutation::getAllTests()
also has been renamedgetTests()
, since it's unclear otherwise whether it's all the tests for the mutations or all the tests in general. Removing just implies the tests for the mutation