Abstract
Benefited on the open source software movement, many code search tools are proposed to retrieve source code over the internet. However, the retrieved source code rarely meets user needs perfectly so that it has to be changed manually. This is because the retrieved source code is concretely over-specific to some particular context. To solve this problem, we propose an Abstract Change Pattern Model (ACPM) to ensure the context-specific source code general for various contexts. This model consists of the ACP abstracting and the ACP concretizing algorithms. The former exploits the abstractly context-aware change pattern from the code changes. Based on the change pattern, the latter transforms the context-specific source code into the correct one meeting different user needs. To evaluate ACPM, we extract 7 topics and collect 5-6 code snippets per topic from the Github, while performing 5 different experiments where we explore 2 sensitivity-related rules and use them to raise the accuracy gradually. Our experimental results show that ACPM is feasible and practical with 73.84% accuracy.
Get full access to this article
View all access options for this article.
