用代码变更指标自动分类,提升开发审查效率
Automated Classification of Source Code Changes Based on Metrics Clustering in the Software Development Process
- 通过度量向量聚类自动划分代码变更类型
- 在5个系统上实现0.75的分类纯度和0.37的熵值
- 适合需要快速分析代码变更的团队使用
本文提出一种基于变更度量聚类的自动化代码变更分类方法。该方法分为两步:首先对每个代码变更计算度量向量并进行聚类,再由专家将聚类结果映射到预定义的变更类别。聚类采用余弦相似度的k-means算法,使用11个度量指标,涵盖行数、圈复杂度、文件数量、接口变化和结构变化等。在五个软件系统(包括Subversion和NHibernate两个开源项目)上验证,结果显示分类纯度P_C = 0.75 ± 0.05,熵值E_C = 0.37 ± 0.06,显著性水平为0.05。
原文摘要 · Abstract (English)
This paper presents an automated method for classifying source code changes during the software development process based on clustering of change metrics. The method consists of two steps: clustering of metric vectors computed for each code change, followed by expert mapping of the resulting clusters to predefined change classes. The distribution of changes into clusters is performed automatically, while the mapping of clusters to classes is carried out by an expert. Automation of the distribution step substantially reduces the time required for code change review. The k-means algorithm with a cosine similarity measure between metric vectors is used for clustering. Eleven source code metrics are employed, covering lines of code, cyclomatic complexity, file counts, interface changes, and structural changes. The method was validated on five software systems, including two open-source projects (Subversion and NHibernate), and demonstrated classification purity of P_C = 0.75 +/- 0.05 and entropy of E_C = 0.37 +/- 0.06 at a significance level of 0.05.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。