You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 main now to see if we get anything useful. I'm already getting a few missed mutants which could indicate some gaps already found. :)
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 --jobs for spawning multiple cargo processes) for me. 2421 mutants tested in 777:57: 505 missed, 1122 caught, 778 unviable, 16 timeouts
So I'm not sure what would be the best way to schedule something like this or maybe set it to run more granularly for PRs. One can filter by functions introduced in a PR. That might be more palatable for CI. Next would be figuring out the best way to use the results.
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 cargo mutate yet but mutagen gives false positives is some cases, I don't think you'll be able to hard fail. An example I have been hitting often is < vs <=
I haven't played with cargo mutate yet but mutagen gives false positives is some cases, I don't think you'll be able to hard fail. An example I have been hitting often is < vs <=
fnabs(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 mutagen repo adding an attribute like rustfmt::skip, it was favorably received but I wasn't able to implement it in the one try I had at it.
From reading the cargo-mutants doc I dont think it does anything like that (it only shows 2421 mutants across all of RL, so its not doing much :) ) - it looks like all it does is check that, for each function, if you can replace it with a completely dummy function returning a static value, it checks that your tests fail. At that level of granularity I feel like showing a CI "X" is reasonable, even if we don't strictly require it for merging.
Oh, thanks for the explanation - it is definitely not a total replacement for mutagen then. I ran it on rust-bitcoin yesterday but haven't gone through the output yet.
At that level of granularity I feel like showing a CI "X" is reasonable, even if we don't strictly require it for merging.
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.
Activity
apoelstra commentedon Sep 19, 2018
Nice!
halfsleep is unmaintained, and I'd probably start contributing to mutagen before I'd start maintaining it again.
TheBlueMatt commentedon Jan 8, 2020
dunxen commentedon Feb 7, 2023
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
mainnow to see if we get anything useful. I'm already getting a few missed mutants which could indicate some gaps already found. :)apoelstra commentedon Feb 7, 2023
cc @tcharding if you're bored and want to play with this one, you might beat me to it:)
tcharding commentedon Feb 7, 2023
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.
dunxen commentedon Feb 8, 2023
Mutating all functions over everything took about 12 hours (without
--jobsfor spawning multiple cargo processes) for me.2421 mutants tested in 777:57: 505 missed, 1122 caught, 778 unviable, 16 timeoutsSo I'm not sure what would be the best way to schedule something like this or maybe set it to run more granularly for PRs. One can filter by functions introduced in a PR. That might be more palatable for CI. Next would be figuring out the best way to use the results.
TheBlueMatt commentedon Feb 9, 2023
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.
tcharding commentedon Feb 9, 2023
I haven't played with
cargo mutateyet butmutagengives false positives is some cases, I don't think you'll be able to hard fail. An example I have been hitting often is<vs<=dunxen commentedon Feb 9, 2023
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
tcharding commentedon Feb 9, 2023
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
mutagenrepo adding an attribute likerustfmt::skip, it was favorably received but I wasn't able to implement it in the one try I had at it.TheBlueMatt commentedon Feb 9, 2023
From reading the
cargo-mutantsdoc I dont think it does anything like that (it only shows 2421 mutants across all of RL, so its not doing much :) ) - it looks like all it does is check that, for each function, if you can replace it with a completely dummy function returning a static value, it checks that your tests fail. At that level of granularity I feel like showing a CI "X" is reasonable, even if we don't strictly require it for merging.tcharding commentedon Feb 9, 2023
Oh, thanks for the explanation - it is definitely not a total replacement for
mutagenthen. I ran it on rust-bitcoin yesterday but haven't gone through the output yet.dunxen commentedon Feb 14, 2023
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.
sourcefrog commentedon Nov 25, 2023
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.
dunxen commentedon Nov 25, 2023
Hey! Thanks, that's awesome. I'll be sure to give it a try soon and let you know how it goes 😄
tnull commentedon Jul 8, 2024
Closing as initial support was added in #2763.