Analyzing and Supporting Adaptation of Online Code ExamplesTechnical TrackIndustry Program
Developers often resort to online Q&A forums such as Stack Overflow for filling their programming needs. Although SO examples are good starting points, they are often incomplete and inadequate for the local context of the developers; adaptation of those examples is necessary to integrate them to production code. As a consequence, the process of adapting online examples is done over and over again, by multiple developers independently. We study 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 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 categories. 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 twelve programmers shows that seeing the commonality and variations in similar GitHub counterparts increases their confidence about how to reuse the given SO example, and helps grasp a more comprehensive view about how to reuse the example differently and avoid common pitfalls.
Wed 29 MayDisplayed time zone: Eastern Time (US & Canada) change
16:00 - 18:00 | Program Comprehension and ReusePapers / Journal-First Papers / Technical Track at St-Paul / Ste-Catherine Chair(s): Baishakhi Ray Columbia University, New York | ||
16:00 20mTalk | Active Inductive Logic Programming for Code SearchTechnical Track Technical Track Aishwarya Sivaraman University of California, Los Angeles, Tianyi Zhang University of California, Los Angeles, Guy Van den Broeck University of California, Los Angeles, Miryung Kim University of California, Los Angeles Pre-print | ||
16:20 10mTalk | The State of Empirical Evaluation in Static Feature LocationJournal-First Journal-First Papers Abdul Razzaq , Asanka Wasala University of Limerick, Chris Exton University of Limerick, Jim Buckley Lero - The Irish Software Research Centre and University of Limerick | ||
16:30 10mTalk | Automatic and accurate expansion of abbreviations in parametersJournal-First Journal-First Papers Yanjie Jiang Beijing Institute of Technology, Hui Liu Beijing Institute of Technology, Jiaqi Zhu Beijing Institute of Technology, Lu Zhang Peking University | ||
16:40 20mTalk | NL2Type: Inferring JavaScript Function Types from Natural Language InformationTechnical Track Technical Track Rabee Sohail Malik TU Darmstadt, Jibesh Patra Technical University of Darmstadt, Michael Pradel University of Stuttgart Pre-print Media Attached File Attached | ||
17:00 20mTalk | Analyzing and Supporting Adaptation of Online Code ExamplesTechnical TrackIndustry Program Technical Track Tianyi Zhang University of California, Los Angeles, Di Yang University of California at Irvine, USA, Crista Lopes , Miryung Kim University of California, Los Angeles Pre-print | ||
17:20 20mTalk | DockerizeMe: Automatic Inference of Environment Dependencies for Python Code SnippetsTechnical Track Technical Track | ||
17:40 20mTalk | Discussion Period Papers |