Analyzing and Supporting Adaptation of Online Code Examples
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. Cited by 8 papers in the map (data through 14 Oct 2026). First posted on arXiv 28 May 2019.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2024: 2; 2025: 3; 2026: 3.
8 papers.
- 2024Instruct or Interact? Exploring and Eliciting LLMs' Capability in Code Snippet Adaptation Through Prompt Engineeringcited by 6
- 2024ZS4C: Zero-Shot Synthesis of Compilable Code for Incomplete Code Snippets using LLMscited by 2
- 2026AdaptEval: A Benchmark for Evaluating Large Language Models on Code Snippet Adaptationcited by 1
- 2025RAILS: Retrieval-Augmented Intelligence for Learning Software Developmentcited by 0
- 2025Wired for Reuse: Automating Context-Aware Code Adaptation in IDEs via LLM-Based Agentcited by 0
- 2025Cerberus: Multi-Agent Reasoning and Coverage-Guided Exploration for Static Detection of Runtime Errorscited by 0
- 2026Coding in a Bubble? Evaluating LLMs in Resolving Context Adaptation Bugs During Code Adaptationcited by 0
- 2026AdaptAgent: A Multi-agent, Domain-Guided Reasoning Framework for Code Adaptationcited by 0
- 2026AdaptAgent: A Multi-agent, Domain-Guided Reasoning Framework for Code Adaptation5 Aug 2026
- 2026Coding in a Bubble? Evaluating LLMs in Resolving Context Adaptation Bugs During Code Adaptation10 Jan 2026
- 2026AdaptEval: A Benchmark for Evaluating Large Language Models on Code Snippet Adaptation8 Jan 2026
- 2025Cerberus: Multi-Agent Reasoning and Coverage-Guided Exploration for Static Detection of Runtime Errors24 Dec 2025
- 2025Wired for Reuse: Automating Context-Aware Code Adaptation in IDEs via LLM-Based Agent2 Jul 2025
- 2025RAILS: Retrieval-Augmented Intelligence for Learning Software Development28 Jun 2025
- 2024Instruct or Interact? Exploring and Eliciting LLMs' Capability in Code Snippet Adaptation Through Prompt Engineering23 Nov 2024
- 2024ZS4C: Zero-Shot Synthesis of Compilable Code for Incomplete Code Snippets using LLMs25 Jan 2024