-
Notifications
You must be signed in to change notification settings - Fork 371
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
Add mutation testing #188
Comments
Nice! halfsleep is unmaintained, and I'd probably start contributing to mutagen before I'd start maintaining it again. |
There’s a new option on the block though this one is language-agnostic and uses LLVM. No idea what the integration work would look like and it may end up just generating a ton of false positives for things in stdlib instead of our own code.
https://github.com/mull-project/mull
… On Sep 19, 2018, at 06:43, Andrew Poelstra ***@***.***> wrote:
Nice!
halfsleep is unmaintained, and I'd probably start contributing to mutagen before I'd start maintaining it again.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
So there's an even newer option now called cargo-mutants that doesn't require modifying any part of the source tree permanently. It's just run as a cargo subcommand which is convenient. I'm running it on |
cc @tcharding if you're bored and want to play with this one, you might beat me to it:) |
Sweet, cheers. Do note before you put an policy in place I've found mutation testing enjoyable because one really has to understand all the code tested but it is slow to implement in my experience. |
Mutating all functions over everything took about 12 hours (without |
Awesome! That's cool. I'm glad there's more mutation testing projects in Rust. As for what to do with the results, I think we should hard fail if new functions can be replaced with dummies with no test failure (Iiuc this is all the cargo mutants project does, no if inversion or so). It may well be very loud, but we can revert it if we get annoyed, and we don't need to require it for merges just yet, first just show a red X. |
I haven't played with fn abs(x: i32) -> u32 {
if x < 0 { -x } else { x };
} |
Yeah, in this case then you'd need to add an ignore attribute to that function. So I think hard fail is still fine and the author can just explicitly ignore that function |
That is definitely one solution, I love to find one that didn't use ignore because I've found false positives pretty common but there is still some advantage in mutating. I'm super new to mutation testing but if you guys come up with anything can you cc me please. I did suggest on the |
From reading the |
Oh, thanks for the explanation - it is definitely not a total replacement for |
I think this would also be an important feature sourcefrog/cargo-mutants#57, but I don't think it's a hard requirement to at least test it out. I'll play around some more and open a PR at some stage. Also seeing what I can contribute upstream. |
Hi, just thought I would let you know cargo-mutants can now do incremental tests on PRs, in https://mutants.rs/in-diff.html. Let me know over there if you have any feedback or hit any problems. |
Hey! Thanks, that's awesome. I'll be sure to give it a try soon and let you know how it goes 😄 |
Closing as initial support was added in #2763. |
We should start requiring full mutation coverage for functions as we build out our unit tests.
https://github.com/llogiq/mutagen looks like a good candidate, unless @apoelstra thinks we should use https://github.com/apoelstra/halfsleep.
Tagging 0.2 as our goal for 0.2 should be to move more towards better test coverage.
The text was updated successfully, but these errors were encountered: