估计source code的缺陷:使用GitHub含量的预测模型
Estimating defectiveness of source code: A predictive model using GitHub content
摘要:
本文提出的两个关键贡献是:i)用于构建包含从开源软件(OSS)和相关错误报告中提取的源文件中提取的源代码特征的数据集的方法,ii)用于估计给定源代码的缺陷的预测模型。这些工件对于构建与几个自动化软件工程领域相关的工具和技术非常有用,例如错误定位、代码审查以及推荐和程序修复。为了实现我们的目标,我们首先为GitHub上的源代码文件提取编码风格信息(例如,与源代码中使用的程序设计语言结构相关)。然后提取与这些源代码文件相关的错误报告(如果有的话)中的可用信息。因此,获取的非(/半)结构化的信息,然后转换成一个结构化的知识库。我们考虑了来自20个不同GitHub存储库的30400多个源代码文件,以及来自4个错误跟踪门户的约14950个相关错误报告。所考虑的源代码文件是用四种程序设计语言编写的(即,C、C++、Java和Python),属于不同类型的应用程序。然后使用知识库训练用于估计给定输入源代码的缺陷性的机器学习(ML)模型。为了选择最好的ML模型,我们评估了8种不同的ML算法,如随机森林,K最近邻和SVM,大约有50个参数配置,以比较它们在我们的任务中的性能。我们的研究结果之一表明,最好的K倍(k=5)交叉验证结果是用NuSVM技术获得的,平均F1得分为0.914。
英文摘要:
Two key contributions presented in this paper are: i) A method for building a dataset containing source code features extracted from source files taken from Open Source Software (OSS) and associated bug reports, ii) A predictive model for estimating defectiveness of a given source code. These artifacts can be useful for building tools and techniques pertaining to several automated software engineering areas such as bug localization, code review, and recommendation and program repair. In order to achieve our goal, we first extract coding style information (e.g. related to programming language constructs used in the source code) for source code files present on GitHub. Then the information available in bug reports (if any) associated with these source code files are extracted. Thus fetched un(/ semi)-structured information is then transformed into a structured knowledge base. We considered more than 30400 source code files from 20 different GitHub repositories with about 14950 associated bug reports across 4 bug tracking portals. The source code files considered are written in four programming languages (viz., C, C++, Java, and Python) and belong to different types of applications. A machine learning (ML) model for estimating the defectiveness of a given input source code is then trained using the knowledge base. In order to pick the best ML model, we evaluated 8 different ML algorithms such as Random Forest, K Nearest Neighbour and SVM with around 50 parameter configurations to compare their performance on our tasks. One of our findings shows that best K-fold (with k=5) cross-validation results are obtained with the NuSVM technique that gives a mean F1 score of 0.914.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。