stryker-mutator / stryker-net

Mutation testing for .NET core and .NET framework!
https://stryker-mutator.io
Apache License 2.0
1.75k stars 176 forks source link

Ability to run single mutation from html report #2670

Open CzBuCHi opened 10 months ago

CzBuCHi commented 10 months ago

Is your feature request related to a problem? Please describe. Imagine project with lots of mutations that stryker will spend couple of minutes slauthering just to find out, that some mutants survived ...

Describe the solution you'd like ... now i would like to:

  1. open html report
  2. find surviving mutant
  3. modify my code
  4. run stryker again, but only as if there was just single selected mutant from 2)
    • this could be done by generating code in mte-drawer-mutant element that i just copy to terminal and run
  5. after all surviving mutans are checked run stryker for whole project again to verify my changes

Describe alternatives you've considered CLI, that will load previous report, filter surviving mutants and run tests only against those ...

Additional context In report all other mutants should get 'ignored' status and source code should be updated.

richardwerkman commented 10 months ago

You could take a look at https://stryker-mutator.io/docs/stryker-net/configuration/#mutate-glob

It supports mutating just a single line in a single file like this dotnet stryker -m "MyFolder/MyService.cs{10..11}"

richardwerkman commented 10 months ago

CLI, that will load previous report, filter surviving mutants and run tests only against those

This sounds interesting. @rouke-broersma would this be a nice feature for hacktoberfest?

CzBuCHi commented 10 months ago

@richardwerkman after reading thru mutate-grob page i think that this could be used to run only survivintg mutants:

sure i could parse json report externally and generate all globs but i dont like it ... (poking around in generated json - specially when its structure may change in next version)