go-gremlins / gremlins

A mutation testing tool for Go.
https://gremlins.dev
Apache License 2.0
187 stars 17 forks source link

[request] only generate mutants in paths that cover changed code #214

Closed SOF3 closed 9 months ago

SOF3 commented 9 months ago

🚀 Feature Request

Is your feature request related to a problem? Please describe

For projects with low test coverage baseline, it is a common [citation needed] practice to enforce only diff coverage rather than full coverage. Mutation testing would be useful to ensure that new tests have sufficient assertions, but its impact is largely diluted by the large amount of unrelated code.

Describe the solution you'd like

During the initial passing run, identify the lines covered by unit tests that cover changed files/lines. When generating mutants, only generate them on these covered lines.

Describe alternatives you've considered

Alternatively, only generate mutants on changed lines to further reduce dilution.

Additional context

rusinikita commented 9 months ago

@k3rn31 @SOF3 Hi! I'd like to make PR on this issue. And already have a draft, because I need that for my project

rusinikita commented 9 months ago

Sorry, I have not seen this issue before I decided to try make change. I was not sure about result.

Here is PR. Take a look, please.

https://github.com/go-gremlins/gremlins/pull/215