Context-Aware Change Pattern for Code Transformation

Zhi‐Ping Liu · Wuhan University Journal of Natural Sciences · 2018

When source code is over-specific to some concrete contexts, developers have to manually change the source code retrieved from the Internet. To solve this problem, we propose the context-aware change pattern (CACP). For a piece of source code, we extract the changes and changes-relevant context from the past code changes, identifying CACP that is the abstract common part of the changes and context. By using CACP, the retrieved source code could be transformed into the suitable one according to different user needs. From the Github we extracted 7 topics, collected 5–6 code snippets per topic and performed 5 different experiments which illustrated that CACP improves code transformation accuracy by 73.84%.

Read the paper · More papers on PaperTik