Forrest logo
back to the infection tool

infection:tldr:81220

infection: Only mutate lines of code that are covered by tests.
$ infection --only-covered
try on your machine

The "infection --only-covered" command is likely related to a software testing tool called "Infection".

Infection is a mutation testing tool used to improve the quality of tests in a software project. Mutation testing involves introducing small changes (called mutants) into your code to simulate potential bugs, and then rerunning the test suite to see if the tests can detect these mutants. If the tests can detect the mutants, it indicates that the tests are sufficient and effective.

The "--only-covered" flag in the command implies that Infection will only mutate code that is covered by tests. This means that the tool will not introduce mutants in the code that is not covered by any tests, as it would not make sense to mutate code that is not being tested. Limiting mutation to covered code ensures that the focus is on improving the quality of tests for code that is actually being tested.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the infection tool