CODIT: Code Editing With Tree-Based Neural Models
Top Cited Papers
- 31 August 2020
- journal article
- research article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Software Engineering
- Vol. 48 (4) , 1385-1399
Abstract
The way developers edit day-to-day code tends to be repetitive, often using existing code elements. Many researchers have tried to automate repetitive code changes by learning from specific change templates which are applied to limited scope. The advancement of deep neural networks and the availability of vast open-source evolutionary data opens up the possibility of automatically learning those templates from the wild. However, deep neural network based modeling for code changes and code in general introduces some specific problems that needs specific attention from research community. For instance, compared to natural language, source code vocabulary can be significantly larger. Further, good changes in code do not break its syntactic structure. Thus, deploying state-of-the-art neural network models without adapting the methods to the source code domain yields sub-optimal results. To this end, we propose a novel tree-based neural network system to model source code changes and learn code change patterns from the wild. Specifically, we propose a tree-based neural machine translation model to learn the probability distribution of changes in code. We realize our model with a change suggestion engine, Codit , and train the model with more than 24k real-world changes and evaluate it on 5k patches. Our evaluation shows the effectiveness of Codit in learning and suggesting patches. Codit can also learn specific bug fix pattern from bug fixing patches and can fix 25 bugs out of 80 bugs in Defects4J.Keywords
All Related Versions
Funding Information
- National Science Foundation (CCF1845893, CCF 1822965, CNS 1842456)
This publication has 77 references indexed in Scilit:
- Refactoring with synthesisACM SIGPLAN Notices, 2013
- Systematic editingACM SIGPLAN Notices, 2011
- A graph-based approach to API usage adaptationACM SIGPLAN Notices, 2010
- Annotation refactoringACM SIGPLAN Notices, 2008
- Example-Based Program TransformationLecture Notes in Computer Science, 2008
- Documenting and automating collateral evolutions in linux device driversACM SIGOPS Operating Systems Review, 2008
- Predicting source code changes by mining change historyIEEE Transactions on Software Engineering, 2004
- A faster algorithm computing string edit distancesJournal of Computer and System Sciences, 1980
- Semantics of context-free languagesTheory of Computing Systems, 1968
- Three models for the description of languageIEEE Transactions on Information Theory, 1956