-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Rename Java Input files and test methods to specify Test functionality #14436
Comments
@MANISH-K-07 how will we find such test methods and input files? How can we prevent this from happening in the future? If we can't automate some solution for this, I can tell you that we will not be able to always remember to use good naming practices. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Please keep communication in PRs and issues short and concise. Your comment at #14436 (comment) can basically be summed as "I don't know".
As stated at #14436 (comment), this will not be an option. if something can't be completely automated, it's just not going to happen consistently.
Please keep condescending/off topic remarks like this completely out of all interactions in our repos/organization. |
This comment was marked as outdated.
This comment was marked as outdated.
Research similar issues in our issue tracker to get some ideas of what we could do here. |
I approved issue to fix what we detected/detecting manually. It can be long ongoing issue with many PRs |
That was the idea, yes |
I am on AnnotationOnSameLineCheckTest |
I'm on NestedForDepthCheckTest |
…CheckTest updated
…CheckTest updated
…CheckTest updated
…CheckTest updated
…ForDepthCheckTest updated" This reverts commit 6580bec.
…CheckTest updated
…avadocCorrectParagraphOne.java
I want to re-question necessity of this issue.
InputMagicNumberCheckHashCodeValue is not valid name as there bunch of other test input code. We do not group code in Inputs by meaning, it is just a placeholders that are limited to 120 lines. that is why we got such indexes 1,2,3 . as has to split files, and there is no good name, for just another input code for default config. When we need to add few lines, contributr can create new file or reuse existing. |
I also want to remind that longer file names is not always good. Windows constraints is putting some of its users on edge of not being able to clone the repo. |
I agree that the input files haven't been grouped/split to follow a specific pattern.
More than half of the name for any file in our test area is occupied by the pattern that we are enforcing |
I see how people are struggling to do updates for this issue. I also struggling to suggest better name. I don't see future of such updates. All existing are ok to stay as is. New inputs we will try to request better names. If we will find good pattern we will reopen this issue |
Response to discussion at #14369 (comment)
Findings from PR #14369 :
Input file -
Test Method -
Nonsense test method/input file naming conventions like this need to be avoided. We must come up with some descriptive name to differentiate these tests, considering the content and their functionality. Naming conventions like "
........One
" in both test method names and test inputs are being followed at present which tell us nothing about the purpose of a given test. Imagine that it is required to come back to this test class in near future. Why does this test exist? What did the author want to validate?A precise naming convention needs to be enforced to give a better idea of what we are testing, without even needing to open up the input file and inspect the configuration and code. Precise naming as mentioned above is an outcome of clear understanding of the check and what it tests, it's functionality or purpose.
Fixing all the Java Input files in checkstyle is possible only through active contributions. So, first of all, a huge Thanks to every new contributor. If you are looking forward to working on this issue, be sure to analyze the test and look at the example PR :
Examples of ideal updates
:Each PR must contain one complete module with all existing filenames and test method names analysed and renamed.
In update, naming should be such that, just by looking at the names, anyone can figure out what the test validates from input file without even having to open it.
Test method name and input file name should be similar and describe what we are testing. Example from link above:
testJavadocVariableOnInnerClassFields
InputJavadocVariableCheckOnInnerClassFields
.javaUpdate in compliance with #6207 (comment) : Input files should be named in the pattern "Input{CheckName}
Check
Xxxx.java" . Here, the word "check" is stressed upon for all renamed input files of src/test path.Thanks a lot !!
The text was updated successfully, but these errors were encountered: