一句话:提出 δ-NFG(带名字流的多版本程序依赖图)与 Flexeme 方法,用图聚类自动拆分纠缠提交,准确率提升 0.14 且快 32 倍。
开发者常将多个不相关的改动打包进同一提交,形成所谓的纠缠提交(tangled commit),这会妨碍 git bisect 的使用、增加补丁理解难度,并给仓库挖掘研究带来噪声。本文提出 δ-NFG:一种同时编码多个程序版本、并以跨边名字/词素标注数据流的多版本程序依赖图,可直接且统一地刻画提交。工具 Flexeme 从提交构建 δ-NFG,再对其施加基于图相似度的凝聚聚类,从而把提交拆分为若干单一关注点的提交。在 C# 语料上,其实现 Heddle 将拆分任务的准确率从此前最优提升 0.14,达到 0.81,同时运行速度比此前最优方法快 32 倍。
Today, most developers bundle changes into commits that they submit to a shared code repository. Tangled commits intermix distinct concerns, such as a bug fix and a new feature. They cause issues for developers, reviewers, and researchers alike: they restrict the usability of tools such as git bisect, make patch comprehension more difficult, and force researchers who mine software repositories to contend with noise. We present a novel data structure, the 𝛿-NFG, a multiversion Program Dependency Graph augmented with name flows. A 𝛿-NFG directly and simultaneously encodes different program versions, thereby capturing commits, and annotates data flow edges with the names/lexemes that flow across them. Our technique, Flexeme, builds a 𝛿-NFG from commits, then applies Agglomerative Clustering using Graph Similarity to that 𝛿-NFG to untangle its commits. At the untangling task on a C# corpus, our implementation, Heddle, improves the state-of-the-art on accuracy by 0.14, achieving 0.81, in a fraction of the time: Heddle is 32 times faster than the previous state-of-the-art.