2019 · 37 citations · 54 references
ComputingComputer ScienceAdaptation StudiesProgramming LanguagesSoftware EngineeringSoftware EvolutionSoftware MaintenanceSoftware RefactoringSoftware ReuseStatic Code AnalysisAdaptation To Local ContextsClone DetectionCode Clone DetectionOnline Template AdaptationSource Code Change AnalysisSource Code EvolutionSource Code ModificationTemplate Adaptation
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.
54
Refactoring improving the design of existing code
Mauricio A. Saca · 2017 · 2.1K citations
The promises and perils of mining GitHub
Eirini Kalliamvakou, Georgios Gousios, Kelly Blincoe et al. · 2014 · 755 citations
Fine-grained and accurate source code differencing
Jean‐Rémy Falleri, Floréal Morandat, Xavier Blanc et al. · 2014 · 550 citations · Full text
Change detection in hierarchically structured information
Sudarshan S. Chawathe, Anand Rajaraman, Héctor García-Molina et al. · 1996 · 488 citations