用代码内容特征预测缺陷,效果优于传统复杂度指标
Defect Prediction with Content-based Features
- 从代码内容提取词汇、类型等特征进行缺陷预测
- 内容特征预测准确率高于代码复杂度指标
- 特征筛选与组合能进一步提升预测效果
传统缺陷预测方法多依赖代码复杂度等度量指标,如源文件行数。本文提出一种基于代码内容的新方法:假设软件代码蕴含其技术特性信息,而这些特性可能具有不同缺陷倾向性。因此,从源码文件中提取的词汇、主题、数据类型、包名等内容特征可用于缺陷预测。我们进行了广泛的实证评估,结果表明:i) 内容特征的预测能力高于代码复杂度指标;ii) 使用特征选择、降维和组合可进一步提升预测性能。
原文摘要 · Abstract (English)
Traditional defect prediction approaches often use metrics that measure the complexity of the design or implementing code of a software system, such as the number of lines of code in a source file. In this paper, we explore a different approach based on content of source code. Our key assumption is that source code of a software system contains information about its technical aspects and those aspects might have different levels of defect-proneness. Thus, content-based features such as words, topics, data types, and package names extracted from a source code file could be used to predict its defects. We have performed an extensive empirical evaluation and found that: i) such content-based features have higher predictive power than code complexity metrics and ii) the use of feature selection, reduction, and combination further improves the prediction performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。