-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Consider using static analysis and formal verification tools #955
Comments
Would you mind filing a PR with the tool(s) of your choice? |
No, I wouldn't mind at all! I'll see if I can find the time later today or this week to submit a PR. |
SonarQube exists in a cloud version, free for use by Open Source projects: https://about.sonarcloud.io/ SonarQube includes support for PMD, FindBugs and more |
@alixwar We could indeed use SonarQube in the future, but I'd feel leery about us primarily depending on it considering that Gradle already comes with first- and third-party support for SpotBugs (FindBugs' current successor), PMD, and other great tools like error-prone. |
...and also considering that SonarQube's cloud version is yet another thing which we don't have a lot of control over. |
@jbduncan Maybe one solution does not exclude the other? My thinking is that bootstrapping SonarQube (which apparantly now supports SpotBugs as well) is probably very quick and easy (based on my experience setting it up locally). It will have no impact on the code base more than a properties file with some metadata so it can easily be removed if decided so. |
You make a good point. I'm most likely dismissing SonarQube out of fear too quickly. :) I personally have no experience with SonarQube, so it's not something I could setup unless I get a lot of free time and develop the inclination to work on it in the future, so I wouldn't mind at all if you wanted to have a stab at it yourself at some point. :) |
Definitely. I can wire it up to a local installation and post some screenshots :) |
I have set it up locally. A few comments:
Some sceenshots (dashboard, list of issues and viewing the details of an issue): |
Here are the changes: #1008 |
Thanks for all your work @alixwar and @jbduncan in this section! Given the amount of time left for RC3 (and higher) and especially for GA, static code analysis might not find it's way into this project's automated build process in the near future. As far as I can see from your manually executed runs and screenshots, there's no show-stopper found in the JUnit 5 code base that would prevent a release. Do you agree? |
There are some (9) violations concerning optionals being retrieved without a "Optional#isPresent()" check.
I'm not familiar with the code so I don't know whether this is a show stopper. |
IIRC, those un-guarded |
Then I'm not aware, at least, of a show stopping issue. But it is a good thing to have static code analysis set up ASAP to avoid building up debt |
@alixwar I actually do have a question regarding SonarQube, thanks for asking. In one of your IntelliJ screenshots above, it shows "violations" like "move left curly brace one line ahead" and "convert tabs to spaces". Although I personally agree with spaces, the JUnit team decided on tabs a long time ago, and they also decided on placing left curly braces as they currently are, so is there a way of telling SonarQube to not report cases like this? |
@sormuras It's a pleasure! :) |
@jbduncan @sormuras This add-on might save some time for reviewing pull requests: https://docs.sonarqube.org/display/PLUG/GitHub+Plugin |
Indeed. Looks nice and clean. |
Pull request: junit-team#961 Issue: junit-team#955
Pull request: junit-team#961 Issue: junit-team#955
Pull request: junit-team#961 Issue: junit-team#955
Pull request: junit-team#961 Issue: junit-team#955
Pull request: junit-team#961 Issue: junit-team#955
Pull request: junit-team#961 Issue: junit-team#955
Pull request: junit-team#961 Issue: junit-team#955
Pull request: junit-team#961 Issue: junit-team#955
Pull request: junit-team#961 Issue: junit-team#955
Related to #358. |
Pull request: junit-team#961 Issue: junit-team#955
In pull request #1008 an implementation of SonarQube was set up. Finally the team decided not to merge it to master. Does it also mean that this issue should be closed or should it be kept open waiting for an alternative? |
This issue will remain open for the time being. The JUnit 5 team is open to alternative solutions but primarily for simple solutions that provide real value to the team. The terms "simple" and "real" are of course left to interpretation by the team itself. |
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. Thank you for your contribution. |
I'm happy to close this issue, actually. I've learned since opening it that a judicious use of static analysis tools is the best kind of use. I still quite like error-prone though. ;) And if SonarQube is ever deemed useful in the future, a new issue could easily be opened there and then. |
Overview
Currently, AFAICT, no static analysis or formal verification tools are being used to catch bugs in the JUnit 5 code base. IMO it would be a sensible thing to do to start using a combination of various tools now, so that when we reach GA and proceed beyond GA, we are less likely to be inundated by preventable bug reports and/or suffer from potential security issues.
I'd personally suggest a combination of the following tools, but I'm more than happy to discuss the merits of the tools listed and to discuss other tools which aren't listed or that I may have not thought of:
Deliverables
The text was updated successfully, but these errors were encountered: