Analyzing and Supporting Adaptation of Online Code Examples
Tianyi Zhang, Di Yang, Cristina Videira Lopes, Miryung Kim

TL;DR
This paper studies how developers adapt online code snippets from Stack Overflow, creating a taxonomy and a tool to analyze and support code adaptation, thereby improving reuse and understanding.
Contribution
It provides a large-scale empirical analysis of code adaptations, develops a taxonomy of adaptation types, and introduces a tool to assist developers in code reuse from online sources.
Findings
Developed a taxonomy of 24 adaptation types.
Built an automated analysis technique using GumTree.
User study shows increased confidence in code reuse.
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Open Source Software Innovations · Web Data Mining and Analysis
