Work

Using Context and Hierarchy Features to Enhance Code Completion in Code Modification Scenarios

Year: 2024
Type: conference-paper
Abstract: Automated software development has always been a research hotspot in the field of software engineering, and code completion can be regarded as a key technology.Currently, many studies on code completion regard the context of prediction as code that strictly appears before the cursor, and have not fully considered the use of code around the cursor for code modification scenarios.Meanwhile, the code serialization method has been developed from source code serialization to Abstract Syntax Tree (AST) serialization.However, AST serialization may lose original structure information.To solve these problems we propose contextual AST serialization (CAS) method, which can more accurately predict AST nodes by capturing the semantic association, context information and structure information between AST nodes.CAS not only converts AST nodes into sequences, but also connects AST sequences with the surrounding context to form richer representations.we conduct empirical studies using a standard Python dataset.The results demonstrate that CAS serialization method significantly improves the code prediction accuracy of the model, the MRR of various types of next token predictions is improved by 15.8% compared to TravTrans on average, and that of type node is improved by 19.4% on average.
Language: English
Open Access status: bronze
OpenAlex ID: W4406255590
FWCI:
Cites:
Cited by:
Related to: 10