Using Topic Model to Suggest Fine Grained Source Code Changes
Prior research has shown that source code and its changes are repetitive. Several approaches have leveraged that phenomenon to detect and recommend change and fix patterns. In this paper, we propose TasC, a model that leverages the context of change tasks in development history to suggest fine grained code change and fix at the program statement level. We use Latent Dirichlet Allocation (LDA) to capture the change task context via co occurring program elements in the changes in a context. We also propose a novel technique for measuring the similarity of code fragments and code changes using the task context. We conducted an empirical evaluation on a large dataset of 88 open source Java projects containing more than 200 thousand source files and 3.5 million source lines of code in their last revisions with 423 thousand changed methods. Our result shows that TasC relatively improves recommendation accuracy up to 130% 250% in comparison with the base models that do not use task context. Compared with other types of contexts, TasC outperforms the models using structural and co change contexts.
2016 IEEE International Conference on Software Maintenance and Evolution (ICSME)