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

mutant: add INVERT_LOOPCTRL mutation #159

Merged

Conversation

alessio-perugini
Copy link
Contributor

@alessio-perugini alessio-perugini commented Sep 8, 2022

Proposed changes

Implement #136 invert loop break/continue

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • Lint and unit tests pass locally with my changes (make all)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Further comments

I've added the loop control support. I'm not sure if the fixtures are good enough.
I was wondering what will happen when changing the control results in an infinite loop?

@pull-request-size pull-request-size bot added the s/M Size: Denotes a Pull Request that changes 30-99 lines label Sep 8, 2022
@alessio-perugini alessio-perugini force-pushed the 136-invert-loop-break-continue branch from 17f6021 to 34cc6c7 Compare September 8, 2022 08:22
@pull-request-size pull-request-size bot added s/L Size: Denotes a Pull Request that changes 100-499 lines and removed s/M Size: Denotes a Pull Request that changes 30-99 lines labels Sep 8, 2022
@alessio-perugini alessio-perugini changed the title chore: add INVERT_LOOPCTRL mutation mutant: add INVERT_LOOPCTRL mutation Sep 8, 2022
@k3rn31 k3rn31 added the c/feature Category: An issue or PR related to a new feature label Sep 8, 2022
@k3rn31 k3rn31 self-assigned this Sep 8, 2022
@codecov
Copy link

codecov bot commented Sep 8, 2022

Codecov Report

Merging #159 (120185b) into main (0b8ecb3) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #159      +/-   ##
==========================================
+ Coverage   88.03%   88.07%   +0.04%     
==========================================
  Files          18       18              
  Lines        1295     1300       +5     
==========================================
+ Hits         1140     1145       +5     
  Misses        128      128              
  Partials       27       27              
Flag Coverage Δ
unittests 88.07% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
internal/configuration/mutantenabled.go 100.00% <ø> (ø)
internal/engine/node.go 100.00% <100.00%> (ø)
internal/mutator/mutator.go 88.23% <100.00%> (+0.73%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@k3rn31
Copy link
Member

k3rn31 commented Sep 8, 2022

Hello @alessio-perugini, thanks for you PR. I enabled the CI for you.

@alessio-perugini
Copy link
Contributor Author

alessio-perugini commented Sep 8, 2022

@k3rn31 thank you! I run a simple test when the mutant generates an infinite loop and the result is a TIMED OUT. Are we okay with that?

@k3rn31
Copy link
Member

k3rn31 commented Sep 8, 2022

@alessio-perugini I'd say it is to be expected in this kind of mutation. It is showing a brittle test case :)

As soon as you mark it as non draft we'll proceed with the review.

@alessio-perugini alessio-perugini marked this pull request as ready for review September 8, 2022 09:04
Copy link
Member

@k3rn31 k3rn31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for the PR. Everything looks good.
Since this kind of mutation can produce lots of unbound loops and, consequently, timeouts, it is maybe better to keep it disabled by default.
Could you please fix that and update the documentation accordingly?

Also, since every mutation increases testing times, we decided to keep all the new mutations disabled by default, leaving to the user the decision to enable them on the basis of project necessities. In the future we'll make some statistics to craft a better core set.

docs/docs/usage/mutations/invert_loop.md Outdated Show resolved Hide resolved
@k3rn31 k3rn31 linked an issue Sep 9, 2022 that may be closed by this pull request
@alessio-perugini alessio-perugini requested review from k3rn31 and removed request for giorgiaroccetti September 9, 2022 07:23
Copy link
Member

@k3rn31 k3rn31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good, I'm going to merge this.

@k3rn31 k3rn31 merged commit da8731e into go-gremlins:main Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/feature Category: An issue or PR related to a new feature s/L Size: Denotes a Pull Request that changes 100-499 lines
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Invert loop break/continue
2 participants