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

Inconsistent library versions notice. #419

Open
kaifeng-h opened this issue Mar 1, 2020 · 0 comments
Open

Inconsistent library versions notice. #419

kaifeng-h opened this issue Mar 1, 2020 · 0 comments

Comments

@kaifeng-h
Copy link

Hi. I have implemented a tool to detect library version inconsistencies. Your project have 1 inconsistent library.

Take commons-io:commons-io for example, this library is declared as version 1.4 in disconf-core, 2.4 in disconf-web and etc... Such version inconsistencies may cause unnecessary maintenance effort in the long run. For example, if two modules become inter-dependent, library version conflict may happen. It has already become a common issue and hinders development progress. Thus a version harmonization is necessary.

Provided we applied a version harmonization, I calculated the cost it may have to harmonize to all upper versions including an up-to-date one. The cost refers to POM config changes and API invocation changes. Take commons-io:commons-io for example, if we harmonize all the library versions into 2.5. The concern is, how much should the project code adapt to the newer library version. We list an effort table to quantify the harmonization cost.

The effort table is listed below. It shows the overall harmonization effort by modules. The columns represents the number of library APIs and API calls(NA,NAC), deleted APIs and API calls(NDA,NDAC) as well as modified API and API calls(NMA,NMAC). Modified APIs refers to those APIs whose call graph is not the same as previous version. Take the first row for example, if upgrading the library into version 2.5. Given that 6 APIs is used in module disconf-client, 0 of them is deleted in a recommended version(which will throw a NoMethodFoundError unless re-compiling the project), 6 of them is regarded as modified which could break the former API contract.

Index Module NA(NAC) NDA(NDAC) NMA(NMAC)
1 disconf-client 6(7) 0(0) 6(7)
2 disconf-web 5(6) 0(0) 3(4)
3 disconf-core 1(1) 0(0) 1(1)

Also we provided another table to show the potential files that may be affected due to library API change, which could help to spot the concerned API usage and rerun the test cases. The table is listed below.

Module File Type API
disconf-core disconf-core/src/main/java/com/baidu/disconf/core/common/utils/FileUtils.java modify org.apache.commons.io.FileUtils.contentEquals(java.io.File,java.io.File)
disconf-web disconf-web/src/test/java/com/baidu/disconf/web/test/utils/CodeUtilsTestCase.java modify org.apache.commons.io.FileUtils.readFileToString(java.io.File,java.lang.String)
disconf-web disconf-web/src/main/java/com/baidu/disconf/web/utils/TarUtils.java modify org.apache.commons.io.IOUtils.copy(java.io.InputStream,java.io.OutputStream)
4 .. .. ..

If you are interested, you can have a more complete and detailed report in the attached PDF file.
knightliao disconf.pdf

Fudan SELab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant