paperbot · PL 论文追踪

全部论文 待读 收藏

P2 UTANGO: untangling commits with context-aware, graph-based, code change clustering learning model

UTango:利用上下文感知、基于图的代码变更聚类学习模型解开提交纠缠
FSE Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2022匹配度 2/10 · 论文聚焦提交拆分与代码变更聚类,使用图神经网络进行表示学习和监督聚类,属于机器学习在软件工程/程序理解中的应用;但它不涉及用户核心关注的静态分析、形式化验证、浮点程序分析、贝叶斯程序分析,也未使用 LLM/Agent 改进这些方向,因此仅与“ML+PL”泛领域有较弱交集。引用 13 inbox
Yi Li, Shaohua Wang, Tien N. Nguyen
crossref: 2026-09-12

AI 速览

一句话:提出 UTango,用上下文感知的图神经网络学习代码变更嵌入,并监督聚类以自动拆分混合关注点的提交。

软件演化中,开发者提交的 commit 常混合多个关注点,导致程序理解困难并降低关注点分离度。已有确定性自动拆分方法难以指定有效的变更聚类准则。本文提出 UTango,一种基于机器学习的提交拆分方法:它学习代码变更的嵌入表示,并将凝聚聚类改造成可监督的聚类学习模型,通过可训练参数和比较预测簇与正确簇的损失函数进行训练。为支持该聚类模型,作者设计了上下文感知、基于图的代码变更表示学习模型,利用 Label-GCN 生成上下文化嵌入,融合程序依赖与变更周围上下文,并显式表示上下文和克隆代码。在 C# 与 Java 数据集上的实验分别使用 1,612 和 14k 个纠缠提交,结果表明 UTango 相对当前最优提交拆分方法的准确率分别提升 28.6%–462.5% 和 13.3%–100.0%。

问题
提交中常混合不同目的的代码变更,自动拆分这些纠缠提交对程序理解和关注点分离很重要,但传统确定性方法难以定义有效的聚类准则。
方法
UTango 将代码变更表示为嵌入,使用 Label-GCN 融合程序依赖与周围上下文,并把凝聚聚类适配为带可训练参数和损失函数的监督聚类学习模型。
评估
在包含 1,612 个 C# 提交和 14k 个 Java 提交的纠缠提交数据集上评估,并与当前最优方法比较,报告了准确率的相对提升。
原文摘要(Abstract)

During software evolution, developers make several changes and commit them into the repositories. Unfortunately, many of them tangle different purposes, both hampering program comprehension and reducing separation of concerns. Automated approaches with deterministic solutions have been proposed to untangle commits. However, specifying an effective clustering criteria on the changes in a commit for untangling is challenging for those approaches. In this work, we present UTango, a machine learning (ML)-based approach that learns to untangle the changes in a commit. We develop a novel code change clustering learning model that learns to cluster the code changes, represented by the embeddings, into different groups with different concerns. We adapt the agglomerative clustering algorithm into a supervised-learning clustering model operating on the learned code change embeddings via trainable parameters and a loss function in comparing the predicted clusters and the correct ones during training. To facilitate our clustering learning model, we develop a context-aware, graph-based, code change representation learning model, leveraging Label, Graph-based Convolution Network to produce the contextualized embeddings for code changes, that integrates program dependencies and the surrounding contexts of the changes. The contexts and cloned code are also explicitly represented, helping UTango distinguish the concerns. Our empirical evaluation on C# and Java datasets with 1,612 and 14k tangled commits show that it achieves the accuracy of 28.6%– 462.5% and 13.3%–100.0% relatively higher than the state-of-the-art commit-untangling approaches for C# and Java, respectively.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot7070,
  title = {UTANGO: untangling commits with context-aware, graph-based, code change clustering learning model},
  author = {Yi Li and Shaohua Wang and Tien N. Nguyen},
  booktitle = {FSE},
  year = {2022},
  doi = {10.1145/3540250.3549171}
}