使用模型无关技术预测缺陷线
Predicting Defective Lines Using a Model-Agnostic Technique
摘要:
提出了缺陷预测模型,以帮助团队根据存在缺陷的可能性对需要软件质量保证(SQA)的源代码区域文件进行优先级排序。然而,开发人员可能会在整个文件上浪费他们不必要的努力,而只有一小部分源代码行是有缺陷的。事实上,我们发现一个文件中只有1%-3%的行是有缺陷的。因此,在这项工作中,我们提出了一个新的框架(称为LINE-DP),以识别缺陷线使用模型不可知的技术,即,一种可解释的人工智能技术,它提供了模型为什么做出这样的预测的信息。一般来说,我们的LINE-DP首先使用代码令牌特征构建文件级缺陷模型。然后,我们的LINE-DP使用最先进的模型不可知技术(即,LIME)来识别风险代币,即,引导文件级缺陷模型预测文件将有缺陷的代码令牌。然后,包含风险令牌的线被预测为缺陷线。通过对9个Java开源系统的32个版本的案例研究,我们的评估结果表明,LINE-DP的平均召回率为0.61,误报率为0.47,前20%的召回率为0.27,初始误报率为16,在统计学上优于6种基线方法。我们的评估表明,我们的LINE-DP需要10秒的平均计算时间,包括模型构建和缺陷线识别时间。此外,我们发现,我们的LINE-DP可以识别的缺陷线中有63%与常见缺陷有关(例如,参数变化,条件变化)。这些结果表明,我们的LINE-DP可以有效地识别包含常见缺陷的缺陷线,同时需要更少量的检查工作和可管理的计算成本。
英文摘要:
Defect prediction models are proposed to help a team prioritize source code areas files that need Software QualityAssurance (SQA) based on the likelihood of having defects. However, developers may waste their unnecessary effort on the whole filewhile only a small fraction of its source code lines are defective. Indeed, we find that as little as 1%-3% of lines of a file are defective. Hence, in this work, we propose a novel framework (called LINE-DP) to identify defective lines using a model-agnostic technique, i.e., an Explainable AI technique that provides information why the model makes such a prediction. Broadly speaking, our LINE-DP first builds a file-level defect model using code token features. Then, our LINE-DP uses a state-of-the-art model-agnostic technique (i.e.,LIME) to identify risky tokens, i.e., code tokens that lead the file-level defect model to predict that the file will be defective. Then, the lines that contain risky tokens are predicted as defective lines. Through a case study of 32 releases of nine Java open source systems, our evaluation results show that our LINE-DP achieves an average recall of 0.61, a false alarm rate of 0.47, a top 20%LOC recall of0.27, and an initial false alarm of 16, which are statistically better than six baseline approaches. Our evaluation shows that our LINE-DP requires an average computation time of 10 seconds including model construction and defective line identification time. In addition, we find that 63% of defective lines that can be identified by our LINE-DP are related to common defects (e.g., argument change, condition change). These results suggest that our LINE-DP can effectively identify defective lines that contain common defectswhile requiring a smaller amount of inspection effort and a manageable computation cost.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。