About to run InfectionPHP on this PHPUnit testsuite... π±
About to run InfectionPHP on this PHPUnit testsuite... π±
If you use #InfectionPHP,
Your initial goal should be to achieve at least 90% code coverage and at least 90% MSI (Mutation Score Indicator).
If your codebase correctly handles all escaped mutants, itβs already strongly typed and behaviorally verified with #PHPUnit tests, without requiring additional static analysis tools.
SA tools will only be useful to identify missing or incomplete docblocks (e.g. array shapes) to improve IDE support and autocomplete accuracy.
Found @sebastian 's article https://phpunit.expert/articles/path-coverage-or-mutation-testing.html very informative on presenting both approaches, well done!
About performances: in my experience Path-Coverage required less time than running the mutation test suite (which includes #phpstan to kill mutants, thanks to @markusstaab IIRC).
Excluding some mutations (ex: on logging methods) never got to a point where Infection was faster than phpunit+coverage.
Maybe I missed something? How do you configure Infection?
#php #infectionPHP #phpunit
Mutation testing with Infection in PHP. #InfectionPHP
Posted into SYMFONY FOR THE DEVIL @symfony-for-the-devil-mobileatom
Ok, so I'm confused about how @infection_php handles these specific mutators that are covered by tests:
Been playing around with #infectionPHP library again, and really happy to see the escaped "edge cases" (or Mutants) it found in my small Symfony project.
It required a bit of configs to: use a phpunit from phar, ignore some legacy code and skip some mutations that do not bring value.
The cool thing? All of those setting were well explained in the documentation, and took just a few lines of config to use them.
Kudos to the team behind that project!
#php #phpunit #symfony
I have an #infectionPHP question: The `_Throws`-Mutation effectively removes my exit condition to avoid an endless recursion loop and thus runs into a Timeout.
The Timeout though apparently is considered bad, given it's not considered a "killed" mutation.
So, how do I make infection happy? I don't know how to avoid an endless recursion when infection would mutate my exit condition away ;)