Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Iterate failures" mode that skips mutations that were caught last time #53

Closed
6 tasks
sourcefrog opened this issue Jul 30, 2022 · 5 comments · Fixed by #354
Closed
6 tasks

"Iterate failures" mode that skips mutations that were caught last time #53

sourcefrog opened this issue Jul 30, 2022 · 5 comments · Fixed by #354
Assignees
Labels
enhancement New feature or request

Comments

@sourcefrog
Copy link
Owner

sourcefrog commented Jul 30, 2022

If someone's iterating on trying to improve coverage it might be helpful to only try mutants that were not caught on the last run, maybe by automatically looking in mutants.out.

However you can get close to this today by narrowing it with -f.

Closely related to #57.


Implementation approach

I'll pick this up, based on ideas for @cl3joly but in a separate branch.

This could be done in either a positive or negative sense:

  • Skip mutants that passed on a previous run: will pick up newly added mutants (probably good); will test mutants that were not yet known to have passed; does require remembering which one are skipped or they will be included in a third run
  • Only test mutants that failed on a previous run

Basic idea is to:

  • Add an --iterate command-line option (it would not make sense to have in the config.)
  • Add the concept of an "previous output directory", by default the same path that will be used for output.
  • Read the previously caught mutants from caught.txt in that output directory
  • (It would help here to also have a list of mutants that were still pending and untested when the previous run finished, Write a file with a list of pending mutants into mutants.out #290.)
  • If those lists are all empty, print an info message that there's no iterative work to do.
  • After generating all the mutants, filter down to only the names that occur in the list. (There's an opportunity here to only generate mutants from files that occur in the lists, but that could be left for later.)

In this approach if you also change the filters, for example focussing on one file at a time, then after that change it will test everything, which seems OK.

@sourcefrog sourcefrog added the enhancement New feature or request label Jul 30, 2022
@cl3joly
Copy link

cl3joly commented Nov 29, 2023

I’m going to give this one a try.

@sourcefrog
Copy link
Owner Author

Great! If you want to talk about the approach or anything please feel to post here or put up a draft PR.

@cl3joly cl3joly mentioned this issue Nov 30, 2023
3 tasks
@cl3joly
Copy link

cl3joly commented Nov 30, 2023

Thanks @sourcefrog , I’ve opened #174 as a draft PR, trying to explain our thought process. Feel free to chime in, keeping in mind that we still need to fix and finish things there.

@sourcefrog sourcefrog linked a pull request Dec 6, 2023 that will close this issue
3 tasks
@ASuciuX
Copy link
Contributor

ASuciuX commented Dec 14, 2023

Hello, I've added my question on the PR, please let me know if it is better to post here instead #174 (comment) .

@sourcefrog sourcefrog changed the title "Incremental" mode that skips mutations that were caught last time "Iterate failures" mode that skips mutations that were caught last time Dec 16, 2023
@sourcefrog sourcefrog self-assigned this Feb 25, 2024
@sourcefrog sourcefrog mentioned this issue Jun 9, 2024
9 tasks
@sourcefrog sourcefrog linked a pull request Jun 9, 2024 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants