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

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.

Authors

Publication Details

Journal
Proceedings/Proceedings of the ... International Conference on Software Engineering and Knowledge Engineering
Published
2024-10-28
DOI
https://doi.org/10.18293/seke2024-123
Primary Topic
Model-Driven Software Engineering Techniques
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Ling Li, Mingjie Xing, Linhai Li
Proceedings/Proceedings of the ... International Conference on Software Engineering and Knowledge Engineering
Model-Driven Software Engineering Techniques
article

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

Ling Li, Mingjie Xing, Linhai Li
article en

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.

Proceedings/Proceedings of the ... International Conference on Software Engineering and Knowledge EngineeringVol. 2024
Chinese Academy of Sciences
Openalex Percentile: Top 74%
Model-Driven Software Engineering Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Using Context and Hierarchy Features to Enhance Code Completion in Code Modification Scenarios — Ling Li, Mingjie Xing, et al. · Proceedings/Proceedings of the ... International Conference on Software Engineering and Knowledge Engineering (2024) | TGRS Research Map | TGRS