一句话:揭示自动静态分析误报检测中因数据泄漏与标签启发式导致性能被高估,并给出评估准则。
自动静态分析工具(如 Findbugs)误报率高,阻碍其采用。已有研究提出用机器学习剪枝误报,只向开发者呈现可操作警告,并基于文件、代码与警告特征构造“黄金特征”,报告了近乎完美的性能。本文对此进行详细分析,发现多个研究使用的实验流程存在数据泄漏与数据重复:真实标签泄漏到度量给定上下文中可操作警告比例的特征中,且测试集中的许多警告也出现在训练集中。作者还指出确定真实标签的警告预言机存在局限,其启发式将给定修订版本中的警告与未来参考修订版本比较,参考修订版本的选择会影响警告分布,且产生的标签与人工预言机不一致。因此,先前观察到的强性能过于乐观,实际采用时未必成立。
Automatic static analysis tools (ASATs), such as Findbugs, have a high false alarm rate. The large number of false alarms produced poses a barrier to adoption. Researchers have proposed the use of machine learning to prune false alarms and present only actionable warnings to developers. The state-of-the-art study has identified a set of “Golden Features” based on metrics computed over the characteristics and history of the file, code, and warning. Recent studies show that machine learning using these features is extremely effective and that they achieve almost perfect performance. We perform a detailed analysis to better understand the strong performance of the “Golden Features”. We found that several studies used an experimental procedure that results in data leakage and data duplication, which are subtle issues with significant implications. Firstly, the ground-truth labels have leaked into features that measure the proportion of actionable warnings in a given context. Secondly, many warnings in the testing dataset appear in the training dataset. Next, we demonstrate limitations in the warning oracle that determines the ground-truth labels, a heuristic comparing warnings in a given revision to a reference revision in the future. We show the choice of reference revision influences the warning distribution. Moreover, the heuristic produces labels that do not agree with human oracles. Hence, the strong performance of these techniques previously seen is overoptimistic of their true performance if adopted in practice. Our results convey several lessons and provide guidelines for evaluating false alarm detectors.