arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1907.00376cs.SE
收藏

SonarQube规则是否会导致bug?

Are SonarQube Rules Inducing Bugs?

Valentina Lenarduzzi, Francesco Lomio, Heikki Huttunen, Davide Taibi

摘要:

背景技术债务分析工具的普及,特别是SonarQube的普及,正在迅速增长。SonarQube提出了一组编码规则,这些规则表示代码中的错误,这些错误很快就会反映在故障中,或者会增加维护工作。然而,我们当地的公司对SonarQube提出的规则的有用性没有信心,并委托我们调查这些规则的错误倾向。Objective.在这项工作中,我们的目标是了解哪些SonarQube规则实际上是容易出错的,并了解哪些机器学习模型可以用来准确地识别容易出错的规则。法我们设计并对21个知名的成熟开源项目进行了实证研究。我们应用SZZ算法来标记导致错误的提交。我们通过比较七种机器学习模型的分类能力来分析故障倾向。结果.在SonarQube为Java定义的202条规则中,只有25条可以被认为具有相对较低的错误倾向。此外,被SonarQube视为“错误”的违规行为通常不容易出错,因此,SonarQube提出的模型的故障预测能力极低。结论SonarQube计算技术债务的规则应该彻底调查,其危害性需要进一步确认。因此,公司应该仔细考虑他们真正需要应用哪些规则,特别是如果他们的目标是减少错误倾向。

英文摘要:

Background. The popularity of tools for analyzing Technical Debt, and particularly the popularity of SonarQube, is increasing rapidly. SonarQube proposes a set of coding rules, which represent something wrong in the code that will soon be reflected in a fault or will increase maintenance effort. However, our local companies were not confident in the usefulness of the rules proposed by SonarQube and contracted us to investigate the fault-proneness of these rules. Objective. In this work we aim at understanding which SonarQube rules are actually fault-prone and to understand which machine learning models can be adopted to accurately identify fault-prone rules. Method. We designed and conducted an empirical study on 21 well-known mature open-source projects. We applied the SZZ algorithm to label the fault-inducing commits. We analyzed the fault-proneness by comparing the classification power of seven machine learning models. Result. Among the 202 rules defined for Java by SonarQube, only 25 can be considered to have relatively low fault-proneness. Moreover, violations considered as "bugs" by SonarQube were generally not fault-prone and, consequently, the fault-prediction power of the model proposed by SonarQube is extremely low. Conclusion. The rules applied by SonarQube for calculating technical debt should be thoroughly investigated and their harmfulness needs to be further confirmed. Therefore, companies should carefully consider which rules they really need to apply, especially if their goal is to reduce fault-proneness.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑