-
Notifications
You must be signed in to change notification settings - Fork 3
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
Detect "Mockery" anti-pattern #393
Comments
@volodya-lombrozo what do you think? |
@h1alexbel I like this idea! We can implement it. However, it's better to check if somebody already implemented something similar inside other linters. Have you checked? |
@volodya-lombrozo not yet, but I can take research this topic |
@volodya-lombrozo assign me, please |
@h1alexbel Thank you! |
@h1alexbel 3 puzzles #396, #397, #398 are still not solved. |
@h1alexbel 2 puzzles #396, #397 are still not solved; solved: #398. |
@h1alexbel the puzzle #397 is still not solved; solved: #396, #398. |
@rultor release, tag is |
@volodya-lombrozo OK, I will release it now. Please check the progress here |
@volodya-lombrozo Done! FYI, the full log is here (took me 6min) |
How about to detect Mockery anti-pattern?
Mockery definition:
Sometimes mocking can be good, and handy. But sometimes developers can lose themselves in their effort to mock out what isn’t being tested. In this case, a unit test contains so many mocks, stubs, and/or fakes that the system under test isn’t even being tested at all, instead data returned from mocks is what is being tested.
Example:
in
pom.xml
we can introduce new parametermaxNumberOfMocks
:Thus, using example above,
jtcop
should fail with message like this:The text was updated successfully, but these errors were encountered: