paper-with-me

Papers

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

2022-05-23 · Xiaoyu Liu, Jinu Jang, Neel Sundaresan, Miltiadis Allamanis, Alexey Svyatkovskiy

In software development, it is common for programmers to copy-paste or port code snippets and then adapt them to their use case. This scenario motivates the code adaptation task -- a variant of program repair which aims to adapt variable identifiers in a pasted snippet of code to the surrounding, preexisting source code. However, no existing approach has been shown to effectively address this task. In this paper, we introduce AdaptivePaste, a learning-based approach to source code adaptation, based on transformers 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. Results suggest that our model can learn to adapt source code with 79.8% accuracy. To evaluate how valuable is AdaptivePaste in practice, we perform a user study with 10 Python developers on a hundred real-world copy-paste instances. The results show that AdaptivePaste reduces the dwell time to nearly half the time it takes for manual code adaptation, and helps to avoid bugs. In addition, we utilize the participant feedback to identify potential avenues for improvement of AdaptivePaste.

📄 PDF Abstract BibTeX arXiv:2205.11023

Code (0)

등록된 구현이 없습니다.

Tasks

Program Repair

Methods 이 논문이 사용한 방법론

Repair 설명 없음
Copy-Paste 설명 없음

Similar Papers 제목 키워드 기반

SIGMA: Semantic-complete Graph Matching for Domain Adaptive Object Detection

2022-03-12 · CVPR 2022 1 · Wuyang Li, Xinyu Liu, Yixuan Yuan

Domain Adaptive Object Detection (DAOD) leverages a labeled domain to learn an object detector generalizing to a novel domain free of annotations. Recent advances align class-conditional distributions by narrowing down c…

Graph MatchingHallucinationobject-detectionObject Detection

Semantics-aware Test-time Adaptation for 3D Human Pose Estimation

2025-02-15 · Qiuxia Lin, Rongyu Chen, Kerui Gu, Angela Yao

This work highlights a semantics misalignment in 3D human pose estimation. For the task of test-time adaptation, the misalignment manifests as overly smoothed and unguided predictions. The smoothing settles predictions t…

3D human pose and shape estimation3D Human Pose Estimation3D Pose Estimationmotion prediction+4

Semantics-Aware Image to Image Translation and Domain Transfer

2019-04-03 · Pravakar Roy, Nicolai Häni, Jun-Jee Chao, Volkan Isler

Image to image translation is the problem of transferring an image from a source domain to a different (but related) target domain. We present a new unsupervised image to image translation technique that leverages the un…

DecoderDomain AdaptationImage-to-Image TranslationObject+2

SA$^{2}$GFM: Enhancing Robust Graph Foundation Models with Structure-Aware Semantic Augmentation

2025-11-26 · Junhua Shi, Qingyun Sun, Haonan Yuan, Xingcheng Fu arxiv

We present Graph Foundation Models (GFMs) which have made significant progress in various tasks, but their robustness against domain noise, structural perturbations, and adversarial attacks remains underexplored. A key l…

Graph ClassificationDomain Adaptation

Semantics-aware Attention Improves Neural Machine Translation

2021-08-17 · ACL ARR August 2021 8 · Anonymous

The integration of syntactic structure into Transformer machine translation has shown positive results, but to our knowledge, no work has attempted to do so with semantic structures. In this work we propose two novel par…

DecoderMachine TranslationTranslation