paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Graph-Based Mining of In-the-Wild, Fine-Grained, Semantic Code Change Patterns

基于图的真实世界细粒度语义代码变更模式挖掘
ICSE 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE)2019匹配度 2/10 · 论文聚焦基于图挖掘代码变更模式,属于软件仓库挖掘与开发者工具,与用户核心关注的 LLM/Agent 静态分析、浮点程序分析、贝叶斯程序分析等方向没有直接交集;仅因使用图结构分析程序依赖而与静态分析有微弱关联。引用 60 inbox
Hoan Anh Nguyen, Tien N. Nguyen, Danny Dig, Son Nguyen, Hieu Tran, Michael Hilton
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出基于图的 CPatMiner,从海量仓库中挖掘细粒度语义代码变更模式,并在开发者调查与对比中验证有效性。

现有代码变更重复性挖掘多依赖语法相似性,难以准确检测语义变更模式。本文提出 CPatMiner,利用细粒度变更图捕获程序依赖,从大规模仓库中挖掘真实世界未知的重复性语义代码变更模式。在 GitHub 5,000+ 项目、170,000+ 开发者语料上评估:108 名开发者中 70% 认可模式有意义,79% 为其命名,44% 希望 IDE 自动化;相比 AST 方法多检测 2.1 倍有意义模式。在 88 个项目、164M SLOC 上构建 322K 变更图、3M 节点,检测 17K 实例,发现 75% 个人模式与他人共享且随时间广泛分布,并呼吁建立社区变更模式数据库。

问题
现有依赖语法相似性的方法难以准确检测细粒度、语义级的代码变更模式,且难以扩展到大规模仓库。
方法
提出 CPatMiner,基于细粒度变更图捕获程序依赖,从大量仓库中挖掘未知的重复性语义变更模式。
评估
结合开发者调查、与 AST 方法对比,以及在 5,000+ GitHub 项目和 88 个长期项目上的挖掘实验,验证模式的有效性、数量与分布。
原文摘要(Abstract)

Prior research exploited the repetitiveness of code changes to enable several tasks such as code completion, bug-fix recommendation, library adaption, etc. These and other novel applications require accurate detection of semantic changes, but the state-of-the-art methods are limited to algorithms that detect specific kinds of changes at the syntactic level. Existing algorithms relying on syntactic similarity have lower accuracy, and cannot effectively detect semantic change patterns. We introduce a novel graph-based mining approach, CPatMiner, to detect previously unknown repetitive changes in the wild, by mining fine-grained semantic code change patterns from a large number of repositories. To overcome unique challenges such as detecting meaningful change patterns and scaling to large repositories, we rely on fine-grained change graphs to capture program dependencies. We evaluate CPatMiner by mining change patterns in a diverse corpus of 5,000+ open-source projects from GitHub across a population of 170,000+ developers. We use three complementary methods. First, we sent the mined patterns to 108 open-source developers. We found that 70% of respondents recognized those patterns as their meaningful frequent changes. Moreover, 79% of respondents even named the patterns, and 44% wanted future IDEs to automate such repetitive changes. We found that the mined change patterns belong to various development activities: adaptive (9%), perfective (20%), corrective (35%) and preventive (36%, including refactorings). Second, we compared our tool with the state-of-the-art, AST-based technique, and reported that it detects 2.1x more meaningful patterns. Third, we use CPatMiner to search for patterns in a corpus of 88 GitHub projects with longer histories consisting of 164M SLOCs. It constructed 322K fine-grained change graphs containing 3M nodes, and detected 17K instances of change patterns from which we provide unique insights on the practice of change patterns among individuals and teams. We found that a large percentage (75%) of the change patterns from individual developers are commonly shared with others, and this holds true for teams. Moreover, we found that the patterns are not intermittent but spread widely over time. Thus, we call for a community-based change pattern database to provide important resources in novel applications.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{NguyenNDNTH19,
  title = {Graph-Based Mining of In-the-Wild, Fine-Grained, Semantic Code Change Patterns},
  author = {Hoan Anh Nguyen and Tien N. Nguyen and Danny Dig and Son Nguyen and Hieu Tran and Michael Hilton},
  booktitle = {ICSE},
  year = {2019},
  doi = {10.1109/icse.2019.00089}
}