paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Analyzing and Supporting Adaptation of Online Code Examples

分析并支持在线代码示例的适配
ICSE 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE)2019匹配度 2/10 · 该论文研究 Stack Overflow 代码示例的适配分析与交互式复用工具,属于软件工程/开发者工具方向;其核心不是静态分析、形式化验证、浮点程序分析或贝叶斯程序分析,也没有涉及 LLM/Agent 改进静态分析,因此与研究画像的核心方向匹配度很低。引用 47 inbox
Tianyi Zhang, Di Yang, Crista Lopes, Miryung Kim
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:通过大规模实证构建 Stack Overflow 代码示例适配分类体系,并实现辅助开发者交互式复用示例的 Chrome 工具。

开发者复用 Stack Overflow 代码示例时,常需按本地程序上下文适配,且不同开发者反复独立完成。本文结合克隆检测、时间戳与 URL 引用,将 SO 帖子关联到 GitHub 对应代码,构建大规模数据集;定性检查 400 个示例后归纳出 24 种适配类型。作者基于 GumTree 实现自动适配分类,并开发 Chrome 扩展 ExampleStack,从示例及对应版本中提取适配感知模板以定位高频修改热点。十六名程序员的用户研究显示,展示相似 GitHub 版本中的共性与变异能提升其复用信心,帮助全面理解不同复用方式并规避常见陷阱。

问题
在线问答论坛中的代码示例常不完整且不适配开发者的本地程序上下文,导致示例集成需要反复手动适配。
方法
构建 SO 与 GitHub 对应代码数据集,归纳 24 种适配类型,并基于 GumTree 实现自动适配分类;实现 Chrome 扩展 ExampleStack,提供适配感知模板和修改热点提示。
评估
对 400 个 SO 示例及其 GitHub 对应版本进行定性分析,并在整个数据集上自动分类;通过 16 名程序员的用户研究评估工具对复用信心和理解的影响。
原文摘要(Abstract)

Developers often resort to online Q&A forums such as Stack Overflow (SO) for filling their programming needs. Although code examples on those forums are good starting points, they are often incomplete and inadequate for developers' local program contexts; adaptation of those examples is necessary to integrate them to production code. As a consequence, the process of adapting online code examples is done over and over again, by multiple developers independently. Our work extensively studies these adaptations and variations, serving as the basis for a tool that helps integrate these online code examples in a target context in an interactive manner. We perform a large-scale empirical study about the nature and extent of adaptations and variations of SO snippets. We construct a comprehensive dataset linking SO posts to GitHub counterparts based on clone detection, time stamp analysis, and explicit URL references. We then qualitatively inspect 400 SO examples and their GitHub counterparts and develop a taxonomy of 24 adaptation types. Using this taxonomy, we build an automated adaptation analysis technique on top of GumTree to classify the entire dataset into these types. We build a Chrome extension called ExampleStack that automatically lifts an adaptation-aware template from each SO example and its GitHub counterparts to identify hot spots where most changes happen. A user study with sixteen programmers shows that seeing the commonalities and variations in similar GitHub counterparts increases their confidence about the given SO example, and helps them grasp a more comprehensive view about how to reuse the example differently and avoid common pitfalls.

链接与引用

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

BibTeX
@inproceedings{abs-1905-12111,
  title = {Analyzing and Supporting Adaptation of Online Code Examples},
  author = {Tianyi Zhang and Di Yang and Crista Lopes and Miryung Kim},
  booktitle = {ICSE},
  year = {2019},
  doi = {10.1109/icse.2019.00046}
}