-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Mutate regexp body #19
Comments
This was discussed briefly in #18. EDIT: This thread is probably worth reading before this one. I think mutation testing of regexps would expose a ton of bugs, since it is fairly rare for someone to actually test all the branches in a regexp, much less having tests that cover injected faults. |
@dkubb Thx for adding reference. I forgot. |
@dkubb I took a short look at the |
I was thinking about this a bit today and I wanted to jot down some of my ideas. I think we can take the existing operators and do some mutations to make sure more cases are covered.
|
Lets add: Force the capturing operator to actually test the capture:
Force the or operator to test both branches
|
Here's another few:
And a few to encourage usage of more compact metacharacters:
|
I also have an idea about expanding metacharacters and character classes to the list of individual characters, and then removing one of those characters and see if the regexp matches. So for example, given The downside for this is that it could mean a potentially very large number of possible mutations. It might need a special mode that just runs these mutations on their own, or a switch that enables it. However, the upside would mean that the tests actually cover more possible kinds of inputs that the regexp will actually match. |
For these I plan "grouped mutations". Where a specific percentage of the On Thu, Jan 31, 2013 at 12:31:28PM -0800, Dan Kubb wrote:
Markus Schirp Phone: +49 201 / 360 379 14 Seonic IT-Systems GbR |
Oh, I just thought of another good one. If we see a regexp like |
Yeah. Also with |
Yeah, although technically |
No they arent:
|
@mbj oh nice I did not know that! |
Your perl background ;) |
Closed by #565! 😄 🎈 |
The rbx AST exposes the regexp as
#source
attribute that containts the source as string. This string could be parsed by a regexp library and the AST could be mutated by an additional mutator treeMutant::Mutator::Regexp
. This will outline many missing testcases.The text was updated successfully, but these errors were encountered: