This website requires JavaScript.

AdaptivePaste: Code Adaptation through Learning Semantics-aware Variable Usage Representations

Xiaoyu LiuMicrosoft RedmondJinu JangNeel SundaresanMiltiadis AllamanisAlexey Svyatkovskiy
摘要
In software development, it is common for programmers to copypaste code snippets and then adapt them to their use case. This scenario motivates code adaptation task -a variant of program repair which aims to adapt all variable identifiers in a pasted snippet of code to the surrounding, preexisting source code. Nevertheless, no existing approach have been shown to effectively address this task. In this paper, we introduce AdaptivePaste, a learning-based approach to source code adaptation, based on the transformer model and a dedicated dataflow-aware deobfuscation pre-training task to learn meaningful representations of variable usage patterns. We evaluate AdaptivePaste on a dataset of code snippets in Python. Evaluation results suggest that our model can learn to adapt copypasted code with 79.8% accuracy.
展开全部
图表提取

暂无人提供速读十问回答

论文十问由沈向洋博士提出,鼓励大家带着这十个问题去阅读论文,用有用的信息构建认知模型。写出自己的十问回答,还有机会在当前页面展示哦。

Q1论文试图解决什么问题?
Q2这是否是一个新的问题?
Q3这篇文章要验证一个什么科学假设?
0
被引用
笔记
问答