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

Additional rules for analyzing test code #4181

Open
adangel opened this issue Oct 28, 2022 · 0 comments
Open

Additional rules for analyzing test code #4181

adangel opened this issue Oct 28, 2022 · 0 comments
Labels
an:enhancement An improvement on existing features / rules

Comments

@adangel
Copy link
Member

adangel commented Oct 28, 2022

Is your feature request related to a problem? Please describe.
This is a feature request originating from the User Survey.
Right now the feature request is very vague and before implementing it, it should be properly defined. Once that is done, the title of this issue should be updated to correctly describe the content.

Describe the solution you'd like
Possible rules can be taken from https://www.tusharma.in/smells/TEST.html

Here are some examples:

  • Assertion Roulette: This is actually JUnitAssertionsShouldIncludeMessage
  • Dead Fields: This is partially UnusedPrivateField.
    For test classes it is suggested to also consider inherited fields. That would require more knowledge about the analyzed project
    (e.g. knowing all usages in all classes).
  • Eager Test: This is maybe JUnitTestContainsTooManyAsserts.
  • For Testers Only: ? - similar to dead fields, but for methods: Would need a usage knowledge over all classes in the project. If the method
    is public, that we can't be sure, that no other code is using it, that we don't know about while analyzing.
  • General Fixture: ? - maybe a (abstract) base test class, that is used by too many tests?
  • many more...

These rules should be marked or grouped somehow to make it obvious, that these rules are intended for test code.
Maybe a curated ruleset could be provided (similar to quickstart).

Describe alternatives you've considered
TODO

Additional context
TODO

@adangel adangel added the an:enhancement An improvement on existing features / rules label Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
an:enhancement An improvement on existing features / rules
Projects
None yet
Development

No branches or pull requests

1 participant