boxed / mutmut

Mutation testing system
https://mutmut.readthedocs.io
BSD 3-Clause "New" or "Revised" License
902 stars 109 forks source link

Support mutating changed lines only #316

Open NouemanKHAL opened 5 months ago

NouemanKHAL commented 5 months ago

It would be more convenient to run something like mutmut run --diff-only without having to manually generate the patch file and use the --use-patch flag.

Some kind of wrapper on top of the --use-patch implementation.

Related to https://github.com/boxed/mutmut/issues/43

boxed commented 5 months ago

Mutmut already does this if you have run a complete mutmut round first.

NouemanKHAL commented 5 months ago

Is that necessary? It's definitely not practical / feasible for large projects...

boxed commented 5 months ago

I guess you could argue for a command that fills the entire mutmut cache with "skipped" for all mutants. Then after that you would get the change mode automatically.

NouemanKHAL commented 5 months ago

I like the idea! However, does that require generating all the mutants? I assume there would be some kind of hashing mechanism to keep track of each mutant.

boxed commented 5 months ago

Well.. yea all the mutants are "generated" on startup in memory. Then they get IDs based on the cache db.

NouemanKHAL commented 5 months ago

Would be done in reasonable time in large projects?

boxed commented 5 months ago

I don't know what you mean by reasonable or large :) But you can try it. If you do mutmut run and suppy --test-time-base it won't run the initial test run. So as soon as you get the number of mutants starting to count up from zero it will have done this work.