-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
review: test: add test for removeAnnotation method #4056
review: test: add test for removeAnnotation method #4056
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about the slow response these days. I'm prioritizing your PRs as I know you're doing the GSOC thing, but I'm just not around that much during vacation times.
Anyway, the test here looks pretty good, but there are a couple of fundamental mistakes/miscomprehensions.
First of all, we don't typically test implementations, but rather test the public interfaces (e.g. CtElement
). Second, you're not actually explicitly testing CtElementImpl
in this test, you're testing the CtClass
interface. How that interface's removeAnnotation
method is implement is an unspecified implementation detail that could change at any time, making the test's specification non-robust.
To fix this, I would either a) place this test inside CtClassTest
or b) explicitly instantiate a CtElementImpl
and test that. I would favor a) as we don't typically test specific implementation details, but the choice is up to you.
It's perfectly fine, do enjoy vacations 🎉, I am too going to grandma's house just after this ends Thanks for prioritizing PRs : )
I will keep this in mind for future
That didn't came to my mind, thanks for letting me know
a) seems fine to me as well |
Co-authored-by: Simon Larsén <[email protected]>
Co-authored-by: Simon Larsén <[email protected]>
For a) realized I first need to migrate |
This PR is already started, so I'm perfectly fine with you skipping that in this case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good @Rohitesh-Kumar-Jain!
#1818
Hi, I have added a new test for the method
removeAnnotation
:These tests are intended to kill this mutation:
Link to #3967