Add excludes for new mutants#5094
Conversation
Add the function name to the encoding::Decodable exclusion so that if new functions are added in the future they will still be tested.
The min_byte_needed function is a simple cast for optimization and does not need to be tested. Add a mutation testing exclude for all of these functions.
Two functions in WitnessEncoder cause infinite loops when mutated. Add excludes for them.
| "Iterator", # Mutating operations in an iterator can result in an infinite loop | ||
| "impl encoding::Decodable", # Mutant replacing Default::default() is equivalent to returning new() | ||
| "<impl encoding::Decodable for .*>::decoder", # Mutant replacing Default::default() is equivalent to returning new() | ||
| "<impl encoding::Decoder for .*>::min_bytes_needed", # Function is just a cast for optimization. |
There was a problem hiding this comment.
What do you mean by this comment 'is just a cast'? Also, give how unsure I was when writing impls for this method it makes me nervous to exclude it. Although I cannot thing of a sane way to mutate it so I I think you are correct to exclude it ...
There was a problem hiding this comment.
FTR I just read #5088 (comment) after reviewing so I see where you got the optimisation bit.
There was a problem hiding this comment.
Since this is approved I'll leave the comment as is. But if you have a better version I'll add it next time. Probably next monday, going by the last few weeks..
There was a problem hiding this comment.
Heh, oops, I read this as "just a case of optimization".
But we can change the comment in a followup.
80f95b2 Update mutant exclude for lifetime syntax change (Jamil Lambert, PhD) 6133e10 Reword mutant exclude comment (Jamil Lambert, PhD) Pull request description: Two mutant excludes stopped working and caused a timeout in the weekly mutation testing. The lifetimes are now elided to fix a clippy error. And an existing comment needs to be updated in response to a review comment on previous PR. - Fix the comment for a mutant exclude as a follow up to #5094. - Change the excludes to match the new syntax and kill the mutants. Together with #5119 Closes #5121 ACKs for top commit: tcharding: ACK 80f95b2 apoelstra: ACK 80f95b2; successfully ran local tests Tree-SHA512: 547f17a9ab1244467458ce57e2914bd74520401d18c5697812c22921bb078af225e9eaf74f1d3c21efeecfba314d4b9d99fb09994bc573abc8fc36094606144d
New mutants were found in the weekly mutation testing. One set is from a function that is for optimization and testing it is unnecessary, the other causes a timeout by changing the return of functions which are used in testing to exit loops.
min_bytes_needed.WitnessEncoderfunctions that cause an infinite loop in mutation testing.Closes #5088