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

[Question] what about adding Exception throwing while mutating #1059

Open
LowLevelMahn opened this issue Nov 21, 2024 · 2 comments
Open

[Question] what about adding Exception throwing while mutating #1059

LowLevelMahn opened this issue Nov 21, 2024 · 2 comments

Comments

@LowLevelMahn
Copy link

... to test exception safetiness

something like on-every-line step by step during test-run

or is something like that complete out of mutation testing scope?

@AlexDenisov
Copy link
Member

Arguably, it can be seen as out of scope, but I see the value in it.
There are no strict rules when it comes to mutation testing, but IMO MT should be changing or removing things from a program, not adding new ones.

Aside from that, the challenge with these kinds of mutations is what to insert (should it be throw 42, throw std::bad_alloc, or throw your_custom_exception?) and where. And the "where" IMO is the hardest part.

I would love to hear suggestions if you have any, otherwise I'll need to think about it a bit more.

@LowLevelMahn
Copy link
Author

Aside from that, the challenge with these kinds of mutations is what to insert (should it be throw 42, throw std::bad_alloc, or throw your_custom_exception?) and where. And the "where" IMO is the hardest part.

where:
(as seen from the source) - wandering from line to line (so at first before first line of code, second next line after first line etc.)
or somewhere randomly

what:
i find that hard too but i like the idea having these 3 you mentioned (or pure random ones) - in the end its random enough to simulate that deep-down-under code which is not in your control is starting to use exception throwing

what-extended:
even adding more harder failes like divison by zero or nullptr-exceptions could be nice for checking the aborting behavior

I'll need to think about it a bit more.

that is what i hoped for :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants