从历史问题视角看静态代码分析器假阴性与假阳性的实证研究
An Empirical Study of False Negatives and Positives of Static Code Analyzers From the Perspective of Historical Issues
AI总结:
本文从历史问题视角系统研究了PMD、SpotBugs和SonarQube等静态代码分析器的假阴性与假阳性问题,揭示了其根本原因,并设计蜕变测试策略成功发现14个新问题。
摘要:
静态代码分析器被广泛用于帮助发现程序缺陷。然而,在实践中,此类分析器的有效性和可用性受到假阴性(FNs)和假阳性(FPs)问题的影响。本文旨在从一个新视角调查此类分析器的FNs和FPs,即检查在问题库中由维护者、用户和研究人员报告的这些分析器FNs和FPs的历史问题——这些历史问题中的每一个都表现为这些分析器历史上的一次FN或FP,并且已被分析器的开发者确认和修复。为此,我们针对来自三种流行的静态代码分析器(即PMD、SpotBugs和SonarQube)的350个FNs/FPs历史问题进行了首次系统性研究。所有这些问题均已由开发者确认并修复。我们调查了这些问题的根本原因以及相应触发问题的程序的特征。研究揭示了几项关于缓解FNs和FPs的新的有趣发现与启示。此外,在我们研究发现的指导下,我们设计了一种蜕变测试策略来发现FNs和FPs。该策略成功发现了14个新的FNs/FPs问题,其中11个已被确认,9个已被开发者修复。我们对所研究的分析器进行的进一步人工调查揭示了一个规则规范问题,以及由于已实现的静态分析的弱点而产生的另外四个FNs/FPs。我们已在https://zenodo.org/doi/10.5281/zenodo.11525129公开发布所有制品(数据集和工具)。
英文摘要:
Static code analyzers are widely used to help find program flaws. However, in practice the effectiveness and usability of such analyzers is affected by the problems of false negatives (FNs) and false positives (FPs). This paper aims to investigate the FNs and FPs of such analyzers from a new perspective, i.e., examining the historical issues of FNs and FPs of these analyzers reported by the maintainers, users and researchers in their issue repositories -- each of these issues manifested as a FN or FP of these analyzers in the history and has already been confirmed and fixed by the analyzers' developers. To this end, we conduct the first systematic study on a broad range of 350 historical issues of FNs/FPs from three popular static code analyzers (i.e., PMD, SpotBugs, and SonarQube). All these issues have been confirmed and fixed by the developers. We investigated these issues' root causes and the characteristics of the corresponding issue-triggering programs. It reveals several new interesting findings and implications on mitigating FNs and FPs. Furthermore, guided by some findings of our study, we designed a metamorphic testing strategy to find FNs and FPs. This strategy successfully found 14 new issues of FNs/FPs, 11 of which have been confirmed and 9 have already been fixed by the developers. Our further manual investigation of the studied analyzers revealed one rule specification issue and additional four FNs/FPs due to the weaknesses of the implemented static analysis. We have made all the artifacts (datasets and tools) publicly available at https://zenodo.org/doi/10.5281/zenodo.11525129.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。