paperbot · PL 论文追踪

全部论文 待读 收藏

P2 CodeMapper: A Language-Agnostic Approach to Mapping Code Regions Across Commits

CodeMapper:一种语言无关的跨提交代码区域映射方法
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 2/10 · 该论文研究跨提交的代码区域映射,属于软件工程与开发者工具范畴,不涉及 LLM/Agent 与静态分析的交叉、形式化验证、浮点程序分析或贝叶斯程序分析等用户核心方向。尽管其语言无关方法和新数据集有一定工程价值,但缺乏 AI/LLM 成分,与用户研究画像匹配度很低。引用 0 inbox
Huimin Hu, Michael Pradel
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出语言无关的 CodeMapper,通过 diff 分析、代码移动检测与相似度选择,将代码区域映射到另一提交中的对应区域。

软件演化中开发者常需把一个提交中的特定代码区域映射到另一个提交,例如查看 if 条件、配置行或函数定义如何变化,这称为代码映射问题。现有 git diff 只展示文件全部变化,其他技术又局限于特定程序元素和语言。本文提出 CodeMapper,独立于具体程序元素与编程语言。方法分两阶段:先分析 diff、检测代码移动并搜索代码片段以产生候选区域;再计算相似度选择最可能的对应区域。作者在四个数据集上评估,包括两个新构建的、涵盖十种流行语言的手工标注数据集。CodeMapper 在 71.0%–94.5% 的案例中正确识别目标区域,比最佳基线绝对提升 1.5–58.8 个百分点。

问题
开发者需要跨提交定位同一代码区域的对应变化,但现有工具或展示整个文件 diff,或只支持特定程序元素和编程语言。
方法
CodeMapper 先分析 diff、检测代码移动并搜索代码片段得到候选区域,再基于相似度选出最可能的目标区域,且不依赖具体程序元素与语言。
评估
在四个数据集(含两个涵盖十种语言的手工标注数据集)上评估,准确率为 71.0%–94.5%,优于最佳基线 1.5–58.8 个百分点。
原文摘要(Abstract)

During software evolution, developers commonly face the problem of mapping a specific code region from one commit to another. For example, they may want to determine how the condition of an if-statement, a specific line in a configuration file, or the definition of a function changes. We call this the code mapping problem. Existing techniques, such as git diff, address this problem only insufficiently because they show all changes made to a file instead of focusing on a code region of the developer’s choice. Other techniques focus on specific code elements and programming languages (e.g., methods in Java), limiting their applicability. This paper introduces CodeMapper, an approach to address the code mapping problem in a way that is independent of specific program elements and programming languages. Given a code region in one commit, CodeMapper finds the corresponding region in another commit. The approach consists of two phases: (i) computing candidate regions by analyzing diffs, detecting code movements, and searching for specific code fragments, and (ii) selecting the most likely target region by calculating similarities. Our evaluation applies CodeMapper to four datasets, including two new hand-annotated datasets containing code region pairs in ten popular programming languages. CodeMapper correctly identifies the expected target region in 71.0%–94.5% of all cases, improving over the best available baselines by 1.5–58.8 absolute percent points.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{abs-2511-05205,
  title = {CodeMapper: A Language-Agnostic Approach to Mapping Code Regions Across Commits},
  author = {Huimin Hu and Michael Pradel},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3773267}
}