可操作警告还不够:利用弱监督推荐有效的可操作警告
Actionable Warning Is Not Enough: Recommending Valid Actionable Warnings with Weak Supervision
AI总结:
针对静态分析工具可操作警告存在大量无效项的问题,通过构建大型数据集并提出两阶段框架ACWRecommender,实现对真实漏洞可操作警告的精准推荐,实验与实际应用验证了其有效性。
摘要:
近年来,静态分析工具在开发者中越来越受欢迎。然而,静态分析工具的广泛采用受到其高误报率的阻碍。先前的研究引入了可操作警告的概念,并构建了一种机器学习方法来区分可操作警告和误报。但是,根据我们的实证观察,当前用于可操作警告收集的假设相当不可靠且不准确,导致大量无效的可操作警告。为了解决这个问题,在本研究中,我们通过挖掘GitHub前500个C仓库中的68,274次回滚,构建了首个大型可操作警告数据集,然后进一步为每个可操作警告分配一个关于其为真实漏洞可能性的弱标签。在此基础上,我们提出了一个名为ACWRecommender的两阶段框架,以自动推荐极有可能是真实漏洞的可操作警告(AWHB)。我们的方法通过识别可操作警告任务(粗粒度检测阶段)来预热预训练模型UniXcoder,并通过弱监督学习(细粒度重排序阶段)将AWHB重新排序到顶部。实验结果表明,在AWHB推荐的nDCG和MRR指标上,我们提出的模型大幅优于多个基线。此外,我们在6个随机选择的项目上运行了我们的工具,并手动检查了2,197个报告警告中的顶级警告,向开发者报告了前10个推荐警告,其中27个已被开发者确认为真实漏洞。开发者可以在大量报告的警告中快速找到真实漏洞,这验证了我们工具的实际用途。
英文摘要:
The use of static analysis tools has gained increasing popularity among developers in the last few years. However, the widespread adoption of static analysis tools is hindered by their high false alarm rates. Previous studies have introduced the concept of actionable warnings and built a machine-learning method to distinguish actionable warnings from false alarms. However, according to our empirical observation, the current assumption used for actionable warning(s) collection is rather shaky and inaccurate, leading to a large number of invalid actionable warnings. To address this problem, in this study, we build the first large actionable warning dataset by mining 68,274 reversions from Top-500 GitHub C repositories, we then take one step further by assigning each actionable warning a weak label regarding its likelihood of being a real bug. Following that, we propose a two-stage framework called ACWRecommender to automatically recommend the actionable warnings with high probability to be real bugs (AWHB). Our approach warms up the pre-trained model UniXcoder by identifying actionable warnings task (coarse-grained detection stage) and rerank AWHB to the top by weakly supervised learning (fine-grained reranking stage). Experimental results show that our proposed model outperforms several baselines by a large margin in terms of nDCG and MRR for AWHB recommendation. Moreover, we ran our tool on 6 randomly selected projects and manually checked the top-ranked warnings from 2,197 reported warnings, we reported top-10 recommended warnings to developers, 27 of them were already confirmed by developers as real bugs. Developers can quickly find real bugs among the massive amount of reported warnings, which verifies the practical usage of our tool.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。