AdaComplete: improve DL-based code completion method’s domain adaptability

Zejun Wang,Fang Liu,Yiyang Hao,Zhi Jin
DOI: https://doi.org/10.1007/s10515-023-00376-y
IF: 1.677
2023-01-01
Automated Software Engineering
Abstract:Code completion is an important feature in integrated development environments that can accelerate the coding process. With the development of deep learning technologies and easy-to-acquire open-source codebases, many Deep Learning based code completion models (DL models) are proposed. These models are trained using the generic source code datasets, resulting in poor domain adaptability. That is, these models suffer from performance loss when helping programmers code in a specific domain, e.g., helping to decide which domain-specific API to call. To solve the problem, we propose AdaComplete , a simple and effective framework that utilizes a local code completion model to compensate DL models’ domain adaptability. The local code completion model is trained using the source codes of the target domain. When used in code completion, given the context, AdaComplete can adaptively choose the recommendations from either the DL model or the local code completion model based on our hand-crafted features. Experimental results show that AdaComplete outperforms state-of-the-art DL-based code completion methods on specific domains and can improve the accuracy by 7% on average.
What problem does this paper attempt to address?