CGCL-codes/awesome-code-intelligence

64

10 commits

updated Dec 21, 2023

See the code

README

Awesome Deep Learning for Code Intelligence

Awesome Maintenance

This document presents a meticulously curated collection of awesome research papers, datasets, and tools dedicated to the application of machine learning techniques in code intelligence.

Code intelligence involves the application of machine learning techniques to extract knowledge from large-scale code repositories, with the aim of developing intelligent tools to improve the quality and productivity of computer programming.

The list includes the publication year for each paper (or the submission year for pre-prints and arXiv articles), the name of the first author, and the publication venue. Additionally, if the code associated with the research is available, it is linked via a corresponding hyperlink.

Code Representation

To represent source code, we need to first determine what to represent. Various work has proposed to extract code features from multiple perspectives, including code tokens, intermediate representation, abstract syntax tree, as well as many kinds of flow graphs.

Code Tokens

Code tokens, shaping the textual appearance of source code, are composed of function name, keywords, and various variable identifiers. These tokens are simple yet effective to represent the semantics of programs. The majority of approaches for processing code involve breaking the program down into a sequence of tokens based on specific delimiters, such as spaces or the capitalization patterns in identifiers (for identifiers like SortList and intArray).

API

There have been multiple methods proposed to analyze the API sequences in programs. One line of work is about mining API usage patterns from a large code corpus to demonstrate how to use an API. Another line of work is API recommendation, which aims to recommend or generate a sequence of APIs for users.

AST

The Abstract Syntax Tree (AST) is a tree-structured intermediate representation of code that describes the syntactic structure of a program. In an AST, the leaf nodes typically correspond to the tokens of variables and method names in the source code, while the non-leaf nodes represent the syntactic structure of code, like function definition, branch functions. As a result, this representation allows ASTs to be useful for both capturing the lexical information (e.g., variable number) and the syntactic structure of the source code. In practice, we can extract ASTs using several open source tools, e.g., tree-sitter parser, and LLVM Clang.

IR

The Intermediate Representation (IR) is a well-formed structure that is independent of programming languages and machine architectures. It is used by compilers to accurately represent the source code during the translation process from the source code to low-level machine code. The IR can express the operations of the target machine. It is natural to enhance the code embeddings via utilizing IRs, with the benefit of limited vocabulary to significantly alleviate the OOV issue.

Code Graphs

Currently, many approaches have been proposed to convert programs into graphs to better represent the rich structural information within the programs, including ControlFlow Graph (CFG), Data-Flow Graph (DFG) and Code Property Graph (CPG). The CFG represents the computation and control flow of a program. In this representation, each node represents a basic block and each edge represents the transitions of control flow in the program. The DFG is a directed graph that illustrates data relationships among various functions. Each node in the DFG has input and output data ports, and each edge links an output port to an input port on another node.

Other Features of Code

In addition to the aforementioned features of code that have already been widely explored, there also exist several kinds of features that are used in some specific scenarios.

Hybrid

To leverage multiple code features, several approaches to representing source code in a hybrid fashion have been developed.

Application

Code Classification

Classifying source code into different classes (e.g., different functionalities and programming languages), is important for many tasks such as code categorization, programming language identification, code prediction, and vulnerability detection. Various studies have been conducted to classify code snippets into categories based on their functionalities.

Vulnerability Detection and Bug Finding

Detecting vulnerabilities or bugs in programs is essential for assuring the quality of software, as well as saves much effort and time for software development. Although many tools have been developed for vulnerability detection, e.g., Clang Static Analyzer, Coverity, Fortify, Flawfinder, Infer, and SVF, most of them are based on static analysis. Recently, a growing number of works employ deep learning to discover vulnerabilities.

YearTitleAuthorVenueCode
2016Automatically Learning Semantic Features for Defect PredictionWang et al.ICSECode
2017Software defect prediction via convolutional neural networkLi et al.QRSCode
2018Automatic feature learning for predicting vulnerable software componentsDam et al.TSECode
2018Vuldeepecker: A deep learning-based system for vulnerability detectionLi et al.NDSSCode
2019μVulDeePecker: A Deep Learning-Based System for Multiclass Vulnerability DetectionZou et al.TPSCCode
2021SySeVR: A framework for using deep learning to detect software vulnerabilitiesLi et al.TDSCCode
2018Cross-project transfer representation learning for vulnerable function discoveryLin et al.TIICode
2018Maximal divergence sequential autoencoder for binary software vulnerability detectionLe et al.ICLRCode
2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural NetworksZhou et al.NeurIPSCode
2020Combining graph-based learning with automated data collection for code vulnerability detectionWang et al.TIFSCode
2021DeepWukong: Statically detecting software vulnerabilities using deep graph neural networkCheng et al.TOSEMCode
2021Combining Graph Neural Networks with Expert Knowledge for Smart Contract Vulnerability DetectionLiu et al.TKDECode
2021Vulnerability Detection with Fine-Grained InterpretationsLi et al.FSECode
2021Interpreting deep learning-based vulnerability detector predictions based on heuristic searchingZou et al.TOSEMCode
2018Deepbugs: A learning approach to name-based bug detectionPradel et al.OOPSLACode
2019Improving bug detection via context-based code representation learning and attention-based neural networksLi et al.OOPSLACode
2020Neural Attribution for Semantic Bug-Localization in Student ProgramsGupta et al.NeurIPSCode
2021Fault Localization with Code Coverage Representation LearningLi et al.ICSECode
2021Learning to find naming issues with big code and small supervisionHe et al.PLDICode

Code Completion

Code completion is a core feature of most modern IDEs. It offers the developers a list of possible code hints based on available information.

Type Inference

Programming languages with dynamic typing, like Python and JavaScript, allow for rapid prototyping for developers and can save the time of software development dramatically. However, without the type information, unexpected run-time errors are prone to occur, which may introduce bugs and produce low-quality code. Current works on type inference, with the aim of automatically inferring variable types, mainly fall into two categories: the static-analysis-based and learning-based.

Code search aims to retrieve a code snippet by a natural-language query (nl-tocode) or code query (code-to-code). The nl-to-code search refers to searching code fragments that have similar semantics to the natural-language query from a codebase. In contrast to nl-to-code search, the input of code-to-code search is source code, rather than natural-language description. The objective of the code-to-code search is to find code snippets that are semantically related to an input code from a codebase.

Code Clone Detection

Numerous software engineering activities, including code reuse, vulnerability detection, and code search, rely on detecting similar code snippets (or code clones). There are basically four main types of code clones: Type-1 code clones are ones that are identical except for spaces, blanks, and comments. Type-2 code clones denote identical code snippets except for the variable, type, literal, and function names. Type-3 code clones denote two code snippets that are almost identical except for a few statements that have been added or removed. Type-4 code clones denote heterogeneous code snippets with similar functionality but differing code structures or syntax. To handle different types of code clones, various works have been proposed.

Code Summarization

Inspired by the text generation work in NLP, many approaches have been put forward to systematically generate a description or function name to summarize the semantics of source code.

YearTitleAuthorVenueCode
2010Supporting program comprehension with source code summarizationHaiduc et al.ICSECode
2013Autocomment: Mining question and answer sites for automatic comment generationWong et al.ASECode
2015Clocom: Mining existing source code for automatic comment generationWong et al.SANERCode
2013Evaluating source code summarization techniques: Replication and expansionEddy et al.ICPCCode
2013Natural Language Models for Predicting Programming CommentsMovshovitz et al.ACLCode
2016A convolutional attention network for extreme summarization of source codeAllamanis et al.ICMLCode
2016Summarizing source code using a neural attention modelIyer et al.ACLCode
2018Deep code comment generationHu et al.ICPCCode
2019code2seq: Generating Sequences from Structured Representations of CodeAlon et al.ICLRCode
2019Structured neural summarizationFernandes et al.ICLRCode
2020A transformer-based approach for source code summarizationAhmad et al.ACLCode
2021SIT: Code Summarization with Structure-Induced TransformerWu et al.ACLCode
2018Improving automatic source code summarization via deep reinforcement learningWan et al.ASECode
2020Improved code summarization via a graph neural networkLeclair et al.ICPCCode
2021CAST: Enhancing Code Summarization with Hierarchical Splitting and Reconstruction of Abstract Syntax TreesShi et al.EMNLPCode
2019A Neural Model for Generating Natural Language Summaries of Program SubroutinesLeclair et al.ICSECode
2020Improved Automatic Summarization of Subroutines via Attention to File ContextHaque et al.MSRCode
2020Suggesting Comment Completions for Python using Neural Language ModelsCiurumelea et al.SANERCode
2020Retrieval-based neural source code summarizationZhang et al.ICSECode
2020Retrieve and refine: exemplar-based neural comment generationWei et al.ASECode
2021Retrieval-Augmented Generation for Code Summarization via Hybrid GNNLiu et al.ICLRCode
2021EditSum: A Retrieve-and-Edit Framework for Source Code SummarizationLi et al.ASECode
2018Summarizing source code with transferred api knowledgeHu et al.IJCAICode
2019Code generation as a dual task of code summarizationWei et al.NeurIPSCode
2020Leveraging Code Generation to Improve Code Retrieval and Summarization via Dual LearningYe et al.WWWCode
2019Learning to Spot and Refactor Inconsistent Method NamesLiu et al.ICSECode
2021Deep Just-In-Time Inconsistency Detection Between Comments and Source Code Panthaplackel et al.AAAICode
2020Suggesting Natural Method Names to Check Name ConsistenciesNguyen et al.ICSECode
2020Learning to Update Natural Language Comments Based on Code Changes Panthaplackel et al.ACLCode
2020Automating Just-In-Time Comment UpdatingLiu et al.ASECode
2021Automating the removal of obsolete TODO commentsGao et al.FSECode

Program Translation

Translating programs from a deprecated programming language to a modern one is important for software maintenance. Many neural machine translation-based methods have been proposed for program translation.

Program Synthesis

Program synthesis is a task for generating source code using high-level specifications (e.g., program descriptions or input-output samples). Given the natural-language inputs, current approaches resort to generating programs through machine translation.

YearTitleAuthorVenueCode
2006Learning for semantic parsing with statistical machine translationWong et al.NAACLCode
2011Automating string processing in spreadsheets using input-output examplesGulwani et al.POPLCode
2014Structured Generative Models of Natural Source CodeMaddison et al.ICMLCode
2015Language to code: Learning semantic parsers for if-this-then-that recipesQuirk et al.ACLCode
2016Language to logical form with neural attentionDong et al.ACLCode
2016Latent attention for if-then program synthesisLiu et al.NIPSCode
2016Improved semantic parsers for if-then statementsBeltagy et al.ACLCode
2016Latent Predictor Networks for Code GenerationLing et al.ACLCode
2017A syntactic neural model for general-purpose code generationYin et al.ACLCode
2017Abstract Syntax Networks for Code Generation and Semantic ParsingRabinovich et al.ACLCode
2017Neural Programming by ExampleShu et al.AAAICode
2017DeepCoder: Learning to write programsBalog et al.ICLRCode
2017RobustFill: Neural Program Learning under Noisy I/ODevlin et al.ICMLCode
2017Seq2sql: Generating structured queries from natural language using reinforcement learningZhong et al.arXivCode
2018Mapping Language to Code in Programmatic ContextIyer et al.EMNLPCode
2018Selecting representative examples for program synthesisPu et al.ICMLCode
2018NL2Bash: A Corpus and Semantic Parser for Natural Language Interface to the Linux Operating SystemLin et al.LRECCode
2018An encoder-decoder framework translating natural language to database queriesCai et al.IJCAICode
2018Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-sql taskYu et al.EMNLPCode
2018Syntaxsqlnet: Syntax tree networks for complex and cross-domain text-to-sql taskYu et al.EMNLPCode
2019Learning to infer program sketchesNye et al.ICMLCode
2019AutoPandas: neural-backed generators for program synthesisBavishi et al.OOPSLACode
2019Sparc: Cross-domain semantic parsing in contextYu et al.ACLCode
2019CoSQL: A conversational text-to-SQL challenge towards cross-domain natural language interfaces to databasesYu et al.EMNLPCode
2019A Grammar-Based Structural CNN Decoder for Code GenerationSun et al.AAAICode
2019Spoc: Search-based pseudocode to codeKulal et al.NIPSCode
2020HISyn: human learning-inspired natural language programmingNan et al.FSECode
2021Evaluating large language models trained on codeChen et al.arXivCode
2022Competition-Level Code Generation with AlphaCodeLi et al.AICode
2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program SynthesisNijkamp et al.arXivCode
2022PaLM: Scaling Language Modeling with PathwaysChowdhery et al.arXivCode
2023InCoder: A Generative Model for Code Infilling and SynthesisFried et al.ICLRCode
2022PanGu-Coder: Program Synthesis with Function-Level Language ModelingChristopoulou et al.arXivCode
2022ERNIE-Code: Beyond English-Centric Cross-lingual Pretraining for Programming LanguagesChai et al.ACL FindingsCode
2023StarCoder: may the source be with you!Li et al.TMLRCode
2023Code Llama: Open Foundation Models for CodeRoziere et al.arXivCode
2023CodeT5+: Open Code Large Language Models for Code Understanding and GenerationWang et al.EMNLPCode
2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Evaluations on HumanEval-XZheng et al.KDDCode

Program Repair

Automatically localizing and repairing bugs in programs can save much manual effort in software development. One line of work is to learn the patterns of how programmers edit the source code, which can be used to check syntax errors while compiling. Another line of work is focusing on repairing programs by generating patches.

YearTitleAuthorVenueCode
2016Automated Correction for Syntax Errors in Programming Assignments using Recurrent Neural NetworksBhatia et al.arXivCode
2018Syntax and Sensibility: Using language models to detect and correct syntax errorsSantos et al.SANERCode
2017DeepFix: Fixing Common C Language Errors by Deep LearningGupta et al.AAAICode
2021SequenceR: Sequence-to-Sequence Learning for End-to-End Program RepairChen et al.TSECode
2018Deep Reinforcement Learning for Programming Language CorrectionGupta et al.arXivCode
2019SampleFix: Learning to Correct Programs by Sampling Diverse FixesHajipour et al.arXivCode
2019Neural Program Repair by Jointly Learning to Localize and RepairVasic et al.ICLRCode
2020Hoppity: Learning graph transformations to detect and fix bugs in programsDinella et al.ICLRCode
2014Neural turing machinesGraves et al.arXivCode
2019DeepDelta: Learning to Repair Compilation ErrorsMesbah et al.FSECode
2020Learning to Fix Build Errors with Graph2Diff Neural NetworksTarlow et al.ICSECode
2020Codit: Code editing with tree-based neural modelsChakraborty et al.TSECode
2021A Syntax-Guided Edit Decoder for Neural Program RepairZhu et al.FSECode
2020Graph-based, Self-Supervised Program Repair from Diagnostic Feedback Yasunaga et al.ICMLCode
2021TFix: Learning to Fix Coding Errors with a Text-to-Text TransformerBerabi et al.ICMLCode
2020Self-Supervised Bug Detection and RepairAllamanis et al.NeurIPSCode
2021CURE: Code-Aware Neural Machine Translation for Automatic Program RepairJiang et al.ICSECode
2018An empirical investigation into learning bug-fixing patches in the wild via neural machine translationTufano et al.ASECode
2018Learning to Generate Corrective Patches using Neural Machine TranslationHata et al.arXivCode
2018Learning to Repair Software Vulnerabilities with Generative Adversarial NetworksHarer et al.NeurIPSCode
2020Synthesize, execute and debug: Learning to repair for neural program synthesisGupta et al.NeurIPSCode
2020DLFix: Context-based Code Transformation Learning for Automated Program Repair Li et al.ICSECode
2020Evaluating Representation Learning of Code Changes for Predicting Patch Correctness in Program RepairTian et al.ASECode
2004At the end of synthesis: narrowing program candidatesShriver et al.ICSE-NIERCode
2020Human-in-the-loop automatic program repairBohme et al.ICSTCode
2021Interactive Patch Filtering as Debugging AidLiang et al.ICSMECode
2019Learning to optimize halide with tree search and random programsAdams et al.TOGCode

Code Optimization

Other Applications

Dataset

YearTitleAuthorVenueCode
2019Codesearchnet challenge: Evaluating the state of semantic code searchHusain et al.arXivCode
2021CoSQA: 20,000+ Web Queries for Code Search and Question AnsweringHuang et al.ACLCode
2016Probabilistic model for code with decision treesRaychev et al.OOPSLACode
2017A parallel corpus of Python functions and documentation strings for automated code documentation and code generationBarone et al.IJCNLPCode
2020PyMT5: multi-mode translation of natural language and Python code with transformersClement et al.EMNLPCode
2018Deep code comment generationHu et al.ICPCCode
2021Retrieval-Augmented Generation for Code Summarization via Hybrid GNNLiu et al.ICLRCode
2018Deep learning type inferenceHellendoorn et al.FSECode
2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding TasksPuri et al.arXivCode
2019JuICe: A Large Scale Distantly Supervised Dataset for Open Domain Context-based Code GenerationAgashe et al.EMNLPCode
2021ProGraML: Graph-based Deep Learning for Program Optimization and AnalysisCummins et al.ICMLCode
2019Recommendations for Datasets for Source Code SummarizationLeclair et al.NAACLCode
2021CoDesc: A Large Code-Description Parallel DatasetHasan et al.ACLCode
2021Measuring Coding Challenge Competence With APPSHendrycks et al.NeurIPSCode
2021AVATAR: A Parallel Corpus for Java-Python Program TranslationAhmad et al.arXivCode
2018StaQC: A Systematically Mined Question-Code Dataset from Stack OverflowYao et al.WWWCode
2021PyTorrent: A Python Library Corpus for Large-scale Language ModelsBahrami et al.arXivCode
2021CodeQA: A Question Answering Dataset for Source Code ComprehensionLiu et al.EMNLPCode
2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and GenerationLu et al.NeurIPSCode

CHALLENGES AND OPPORTUNITIES

Comprehensive Code Representation

Multi-Lingual and Cross-Language

Model Interpretability

Robustness and Security

Contributors

wanyao1992

9 commits

3usi9

1 commits

CGCL-codes/awesome-code-intelligence

64

10 commits

updated Dec 21, 2023

See the code

README

Awesome Deep Learning for Code Intelligence

Awesome Maintenance

This document presents a meticulously curated collection of awesome research papers, datasets, and tools dedicated to the application of machine learning techniques in code intelligence.

Code intelligence involves the application of machine learning techniques to extract knowledge from large-scale code repositories, with the aim of developing intelligent tools to improve the quality and productivity of computer programming.

The list includes the publication year for each paper (or the submission year for pre-prints and arXiv articles), the name of the first author, and the publication venue. Additionally, if the code associated with the research is available, it is linked via a corresponding hyperlink.

Code Representation

To represent source code, we need to first determine what to represent. Various work has proposed to extract code features from multiple perspectives, including code tokens, intermediate representation, abstract syntax tree, as well as many kinds of flow graphs.

Code Tokens

Code tokens, shaping the textual appearance of source code, are composed of function name, keywords, and various variable identifiers. These tokens are simple yet effective to represent the semantics of programs. The majority of approaches for processing code involve breaking the program down into a sequence of tokens based on specific delimiters, such as spaces or the capitalization patterns in identifiers (for identifiers like SortList and intArray).

API

There have been multiple methods proposed to analyze the API sequences in programs. One line of work is about mining API usage patterns from a large code corpus to demonstrate how to use an API. Another line of work is API recommendation, which aims to recommend or generate a sequence of APIs for users.

AST

The Abstract Syntax Tree (AST) is a tree-structured intermediate representation of code that describes the syntactic structure of a program. In an AST, the leaf nodes typically correspond to the tokens of variables and method names in the source code, while the non-leaf nodes represent the syntactic structure of code, like function definition, branch functions. As a result, this representation allows ASTs to be useful for both capturing the lexical information (e.g., variable number) and the syntactic structure of the source code. In practice, we can extract ASTs using several open source tools, e.g., tree-sitter parser, and LLVM Clang.

IR

The Intermediate Representation (IR) is a well-formed structure that is independent of programming languages and machine architectures. It is used by compilers to accurately represent the source code during the translation process from the source code to low-level machine code. The IR can express the operations of the target machine. It is natural to enhance the code embeddings via utilizing IRs, with the benefit of limited vocabulary to significantly alleviate the OOV issue.

Code Graphs

Currently, many approaches have been proposed to convert programs into graphs to better represent the rich structural information within the programs, including ControlFlow Graph (CFG), Data-Flow Graph (DFG) and Code Property Graph (CPG). The CFG represents the computation and control flow of a program. In this representation, each node represents a basic block and each edge represents the transitions of control flow in the program. The DFG is a directed graph that illustrates data relationships among various functions. Each node in the DFG has input and output data ports, and each edge links an output port to an input port on another node.

Other Features of Code

In addition to the aforementioned features of code that have already been widely explored, there also exist several kinds of features that are used in some specific scenarios.

Hybrid

To leverage multiple code features, several approaches to representing source code in a hybrid fashion have been developed.

Application

Code Classification

Classifying source code into different classes (e.g., different functionalities and programming languages), is important for many tasks such as code categorization, programming language identification, code prediction, and vulnerability detection. Various studies have been conducted to classify code snippets into categories based on their functionalities.

Vulnerability Detection and Bug Finding

Detecting vulnerabilities or bugs in programs is essential for assuring the quality of software, as well as saves much effort and time for software development. Although many tools have been developed for vulnerability detection, e.g., Clang Static Analyzer, Coverity, Fortify, Flawfinder, Infer, and SVF, most of them are based on static analysis. Recently, a growing number of works employ deep learning to discover vulnerabilities.

YearTitleAuthorVenueCode
2016Automatically Learning Semantic Features for Defect PredictionWang et al.ICSECode
2017Software defect prediction via convolutional neural networkLi et al.QRSCode
2018Automatic feature learning for predicting vulnerable software componentsDam et al.TSECode
2018Vuldeepecker: A deep learning-based system for vulnerability detectionLi et al.NDSSCode
2019μVulDeePecker: A Deep Learning-Based System for Multiclass Vulnerability DetectionZou et al.TPSCCode
2021SySeVR: A framework for using deep learning to detect software vulnerabilitiesLi et al.TDSCCode
2018Cross-project transfer representation learning for vulnerable function discoveryLin et al.TIICode
2018Maximal divergence sequential autoencoder for binary software vulnerability detectionLe et al.ICLRCode
2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural NetworksZhou et al.NeurIPSCode
2020Combining graph-based learning with automated data collection for code vulnerability detectionWang et al.TIFSCode
2021DeepWukong: Statically detecting software vulnerabilities using deep graph neural networkCheng et al.TOSEMCode
2021Combining Graph Neural Networks with Expert Knowledge for Smart Contract Vulnerability DetectionLiu et al.TKDECode
2021Vulnerability Detection with Fine-Grained InterpretationsLi et al.FSECode
2021Interpreting deep learning-based vulnerability detector predictions based on heuristic searchingZou et al.TOSEMCode
2018Deepbugs: A learning approach to name-based bug detectionPradel et al.OOPSLACode
2019Improving bug detection via context-based code representation learning and attention-based neural networksLi et al.OOPSLACode
2020Neural Attribution for Semantic Bug-Localization in Student ProgramsGupta et al.NeurIPSCode
2021Fault Localization with Code Coverage Representation LearningLi et al.ICSECode
2021Learning to find naming issues with big code and small supervisionHe et al.PLDICode

Code Completion

Code completion is a core feature of most modern IDEs. It offers the developers a list of possible code hints based on available information.

Type Inference

Programming languages with dynamic typing, like Python and JavaScript, allow for rapid prototyping for developers and can save the time of software development dramatically. However, without the type information, unexpected run-time errors are prone to occur, which may introduce bugs and produce low-quality code. Current works on type inference, with the aim of automatically inferring variable types, mainly fall into two categories: the static-analysis-based and learning-based.

Code search aims to retrieve a code snippet by a natural-language query (nl-tocode) or code query (code-to-code). The nl-to-code search refers to searching code fragments that have similar semantics to the natural-language query from a codebase. In contrast to nl-to-code search, the input of code-to-code search is source code, rather than natural-language description. The objective of the code-to-code search is to find code snippets that are semantically related to an input code from a codebase.

Code Clone Detection

Numerous software engineering activities, including code reuse, vulnerability detection, and code search, rely on detecting similar code snippets (or code clones). There are basically four main types of code clones: Type-1 code clones are ones that are identical except for spaces, blanks, and comments. Type-2 code clones denote identical code snippets except for the variable, type, literal, and function names. Type-3 code clones denote two code snippets that are almost identical except for a few statements that have been added or removed. Type-4 code clones denote heterogeneous code snippets with similar functionality but differing code structures or syntax. To handle different types of code clones, various works have been proposed.

Code Summarization

Inspired by the text generation work in NLP, many approaches have been put forward to systematically generate a description or function name to summarize the semantics of source code.

YearTitleAuthorVenueCode
2010Supporting program comprehension with source code summarizationHaiduc et al.ICSECode
2013Autocomment: Mining question and answer sites for automatic comment generationWong et al.ASECode
2015Clocom: Mining existing source code for automatic comment generationWong et al.SANERCode
2013Evaluating source code summarization techniques: Replication and expansionEddy et al.ICPCCode
2013Natural Language Models for Predicting Programming CommentsMovshovitz et al.ACLCode
2016A convolutional attention network for extreme summarization of source codeAllamanis et al.ICMLCode
2016Summarizing source code using a neural attention modelIyer et al.ACLCode
2018Deep code comment generationHu et al.ICPCCode
2019code2seq: Generating Sequences from Structured Representations of CodeAlon et al.ICLRCode
2019Structured neural summarizationFernandes et al.ICLRCode
2020A transformer-based approach for source code summarizationAhmad et al.ACLCode
2021SIT: Code Summarization with Structure-Induced TransformerWu et al.ACLCode
2018Improving automatic source code summarization via deep reinforcement learningWan et al.ASECode
2020Improved code summarization via a graph neural networkLeclair et al.ICPCCode
2021CAST: Enhancing Code Summarization with Hierarchical Splitting and Reconstruction of Abstract Syntax TreesShi et al.EMNLPCode
2019A Neural Model for Generating Natural Language Summaries of Program SubroutinesLeclair et al.ICSECode
2020Improved Automatic Summarization of Subroutines via Attention to File ContextHaque et al.MSRCode
2020Suggesting Comment Completions for Python using Neural Language ModelsCiurumelea et al.SANERCode
2020Retrieval-based neural source code summarizationZhang et al.ICSECode
2020Retrieve and refine: exemplar-based neural comment generationWei et al.ASECode
2021Retrieval-Augmented Generation for Code Summarization via Hybrid GNNLiu et al.ICLRCode
2021EditSum: A Retrieve-and-Edit Framework for Source Code SummarizationLi et al.ASECode
2018Summarizing source code with transferred api knowledgeHu et al.IJCAICode
2019Code generation as a dual task of code summarizationWei et al.NeurIPSCode
2020Leveraging Code Generation to Improve Code Retrieval and Summarization via Dual LearningYe et al.WWWCode
2019Learning to Spot and Refactor Inconsistent Method NamesLiu et al.ICSECode
2021Deep Just-In-Time Inconsistency Detection Between Comments and Source Code Panthaplackel et al.AAAICode
2020Suggesting Natural Method Names to Check Name ConsistenciesNguyen et al.ICSECode
2020Learning to Update Natural Language Comments Based on Code Changes Panthaplackel et al.ACLCode
2020Automating Just-In-Time Comment UpdatingLiu et al.ASECode
2021Automating the removal of obsolete TODO commentsGao et al.FSECode

Program Translation

Translating programs from a deprecated programming language to a modern one is important for software maintenance. Many neural machine translation-based methods have been proposed for program translation.

Program Synthesis

Program synthesis is a task for generating source code using high-level specifications (e.g., program descriptions or input-output samples). Given the natural-language inputs, current approaches resort to generating programs through machine translation.

YearTitleAuthorVenueCode
2006Learning for semantic parsing with statistical machine translationWong et al.NAACLCode
2011Automating string processing in spreadsheets using input-output examplesGulwani et al.POPLCode
2014Structured Generative Models of Natural Source CodeMaddison et al.ICMLCode
2015Language to code: Learning semantic parsers for if-this-then-that recipesQuirk et al.ACLCode
2016Language to logical form with neural attentionDong et al.ACLCode
2016Latent attention for if-then program synthesisLiu et al.NIPSCode
2016Improved semantic parsers for if-then statementsBeltagy et al.ACLCode
2016Latent Predictor Networks for Code GenerationLing et al.ACLCode
2017A syntactic neural model for general-purpose code generationYin et al.ACLCode
2017Abstract Syntax Networks for Code Generation and Semantic ParsingRabinovich et al.ACLCode
2017Neural Programming by ExampleShu et al.AAAICode
2017DeepCoder: Learning to write programsBalog et al.ICLRCode
2017RobustFill: Neural Program Learning under Noisy I/ODevlin et al.ICMLCode
2017Seq2sql: Generating structured queries from natural language using reinforcement learningZhong et al.arXivCode
2018Mapping Language to Code in Programmatic ContextIyer et al.EMNLPCode
2018Selecting representative examples for program synthesisPu et al.ICMLCode
2018NL2Bash: A Corpus and Semantic Parser for Natural Language Interface to the Linux Operating SystemLin et al.LRECCode
2018An encoder-decoder framework translating natural language to database queriesCai et al.IJCAICode
2018Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-sql taskYu et al.EMNLPCode
2018Syntaxsqlnet: Syntax tree networks for complex and cross-domain text-to-sql taskYu et al.EMNLPCode
2019Learning to infer program sketchesNye et al.ICMLCode
2019AutoPandas: neural-backed generators for program synthesisBavishi et al.OOPSLACode
2019Sparc: Cross-domain semantic parsing in contextYu et al.ACLCode
2019CoSQL: A conversational text-to-SQL challenge towards cross-domain natural language interfaces to databasesYu et al.EMNLPCode
2019A Grammar-Based Structural CNN Decoder for Code GenerationSun et al.AAAICode
2019Spoc: Search-based pseudocode to codeKulal et al.NIPSCode
2020HISyn: human learning-inspired natural language programmingNan et al.FSECode
2021Evaluating large language models trained on codeChen et al.arXivCode
2022Competition-Level Code Generation with AlphaCodeLi et al.AICode
2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program SynthesisNijkamp et al.arXivCode
2022PaLM: Scaling Language Modeling with PathwaysChowdhery et al.arXivCode
2023InCoder: A Generative Model for Code Infilling and SynthesisFried et al.ICLRCode
2022PanGu-Coder: Program Synthesis with Function-Level Language ModelingChristopoulou et al.arXivCode
2022ERNIE-Code: Beyond English-Centric Cross-lingual Pretraining for Programming LanguagesChai et al.ACL FindingsCode
2023StarCoder: may the source be with you!Li et al.TMLRCode
2023Code Llama: Open Foundation Models for CodeRoziere et al.arXivCode
2023CodeT5+: Open Code Large Language Models for Code Understanding and GenerationWang et al.EMNLPCode
2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Evaluations on HumanEval-XZheng et al.KDDCode

Program Repair

Automatically localizing and repairing bugs in programs can save much manual effort in software development. One line of work is to learn the patterns of how programmers edit the source code, which can be used to check syntax errors while compiling. Another line of work is focusing on repairing programs by generating patches.

YearTitleAuthorVenueCode
2016Automated Correction for Syntax Errors in Programming Assignments using Recurrent Neural NetworksBhatia et al.arXivCode
2018Syntax and Sensibility: Using language models to detect and correct syntax errorsSantos et al.SANERCode
2017DeepFix: Fixing Common C Language Errors by Deep LearningGupta et al.AAAICode
2021SequenceR: Sequence-to-Sequence Learning for End-to-End Program RepairChen et al.TSECode
2018Deep Reinforcement Learning for Programming Language CorrectionGupta et al.arXivCode
2019SampleFix: Learning to Correct Programs by Sampling Diverse FixesHajipour et al.arXivCode
2019Neural Program Repair by Jointly Learning to Localize and RepairVasic et al.ICLRCode
2020Hoppity: Learning graph transformations to detect and fix bugs in programsDinella et al.ICLRCode
2014Neural turing machinesGraves et al.arXivCode
2019DeepDelta: Learning to Repair Compilation ErrorsMesbah et al.FSECode
2020Learning to Fix Build Errors with Graph2Diff Neural NetworksTarlow et al.ICSECode
2020Codit: Code editing with tree-based neural modelsChakraborty et al.TSECode
2021A Syntax-Guided Edit Decoder for Neural Program RepairZhu et al.FSECode
2020Graph-based, Self-Supervised Program Repair from Diagnostic Feedback Yasunaga et al.ICMLCode
2021TFix: Learning to Fix Coding Errors with a Text-to-Text TransformerBerabi et al.ICMLCode
2020Self-Supervised Bug Detection and RepairAllamanis et al.NeurIPSCode
2021CURE: Code-Aware Neural Machine Translation for Automatic Program RepairJiang et al.ICSECode
2018An empirical investigation into learning bug-fixing patches in the wild via neural machine translationTufano et al.ASECode
2018Learning to Generate Corrective Patches using Neural Machine TranslationHata et al.arXivCode
2018Learning to Repair Software Vulnerabilities with Generative Adversarial NetworksHarer et al.NeurIPSCode
2020Synthesize, execute and debug: Learning to repair for neural program synthesisGupta et al.NeurIPSCode
2020DLFix: Context-based Code Transformation Learning for Automated Program Repair Li et al.ICSECode
2020Evaluating Representation Learning of Code Changes for Predicting Patch Correctness in Program RepairTian et al.ASECode
2004At the end of synthesis: narrowing program candidatesShriver et al.ICSE-NIERCode
2020Human-in-the-loop automatic program repairBohme et al.ICSTCode
2021Interactive Patch Filtering as Debugging AidLiang et al.ICSMECode
2019Learning to optimize halide with tree search and random programsAdams et al.TOGCode

Code Optimization

Other Applications

Dataset

YearTitleAuthorVenueCode
2019Codesearchnet challenge: Evaluating the state of semantic code searchHusain et al.arXivCode
2021CoSQA: 20,000+ Web Queries for Code Search and Question AnsweringHuang et al.ACLCode
2016Probabilistic model for code with decision treesRaychev et al.OOPSLACode
2017A parallel corpus of Python functions and documentation strings for automated code documentation and code generationBarone et al.IJCNLPCode
2020PyMT5: multi-mode translation of natural language and Python code with transformersClement et al.EMNLPCode
2018Deep code comment generationHu et al.ICPCCode
2021Retrieval-Augmented Generation for Code Summarization via Hybrid GNNLiu et al.ICLRCode
2018Deep learning type inferenceHellendoorn et al.FSECode
2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding TasksPuri et al.arXivCode
2019JuICe: A Large Scale Distantly Supervised Dataset for Open Domain Context-based Code GenerationAgashe et al.EMNLPCode
2021ProGraML: Graph-based Deep Learning for Program Optimization and AnalysisCummins et al.ICMLCode
2019Recommendations for Datasets for Source Code SummarizationLeclair et al.NAACLCode
2021CoDesc: A Large Code-Description Parallel DatasetHasan et al.ACLCode
2021Measuring Coding Challenge Competence With APPSHendrycks et al.NeurIPSCode
2021AVATAR: A Parallel Corpus for Java-Python Program TranslationAhmad et al.arXivCode
2018StaQC: A Systematically Mined Question-Code Dataset from Stack OverflowYao et al.WWWCode
2021PyTorrent: A Python Library Corpus for Large-scale Language ModelsBahrami et al.arXivCode
2021CodeQA: A Question Answering Dataset for Source Code ComprehensionLiu et al.EMNLPCode
2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and GenerationLu et al.NeurIPSCode

CHALLENGES AND OPPORTUNITIES

Comprehensive Code Representation

Multi-Lingual and Cross-Language

Model Interpretability

Robustness and Security

Contributors

wanyao1992

9 commits

3usi9

1 commits