How Important are Good Method Names in Neural Code Generation? A Model Robustness Perspective
Guang Yang, Yu Zhou, Wenhua Yang, Tao Yue, Xiang Chen, Taolue Chen

TL;DR
This paper investigates the significance of method names in neural code generation models, proposing a robustness framework with attack and defense mechanisms that demonstrate the impact of method name quality on code generation performance.
Contribution
It introduces RADAR, a novel approach with attack and defense components, to evaluate and enhance the robustness of pre-trained code generation models against method name perturbations.
Findings
Adversarial method names significantly reduce code quality metrics.
Synthesized method names can restore model performance.
Method name quality critically affects neural code generation robustness.
Abstract
Pre-trained code generation models (PCGMs) have been widely applied in neural code generation which can generate executable code from functional descriptions in natural languages, possibly together with signatures. Despite substantial performance improvement of PCGMs, the role of method names in neural code generation has not been thoroughly investigated. In this paper, we study and demonstrate the potential of benefiting from method names to enhance the performance of PCGMs, from a model robustness perspective. Specifically, we propose a novel approach, named RADAR (neuRAl coDe generAtor Robustifier). RADAR consists of two components: RADAR-Attack and RADAR-Defense. The former attacks a PCGM by generating adversarial method names as part of the input, which are semantic and visual similar to the original input, but may trick the PCGM to generate completely unrelated code snippets. As a…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Testing and Debugging Techniques · Topic Modeling
