About to run InfectionPHP on this PHPUnit testsuite... 😱

#InfectionPHP #PHP #PHPUnit

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.

https://github.com/sponsors/infection

#PHP

Sponsor @infection on GitHub Sponsors

Mutation Testing for PHP. Helps writing better code and tests.

GitHub

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

Path Coverage or Mutation Testing?

How thoroughly do your tests cover the code, and how reliably do they detect real errors? I show you how to find out.

phpunit.expert
Mutation testing with Infection in PHP

Recently I started playing with Infection, a mutation testing framework for PHP. Mutation testing is a technique to evaluate the quality of your tests.

My developer experience
Mutation testing with Infection in PHP

Recently I started playing with Infection, a mutation testing framework for PHP. Mutation testing is a technique to evaluate the quality of your tests.

My developer experience

Ok, so I'm confused about how @infection_php handles these specific mutators that are covered by tests:

#PHPUnit #InfectionPHP #PHP

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 ;)