DeepBugs: A Learning Approach to Name-based Bug Detection
Not on the map. Why?
Abstract (arXiv)
Natural language elements in source code, e.g., the names of variables and functions, convey useful information. However, most existing bug detection tools ignore this information and therefore miss some classes of bugs. The few existing name-based bug detection approaches reason about names on a syntactic level and rely on manually designed and tuned algorithms to detect bugs. This paper presents DeepBugs, a learning approach to name-based bug detection, which reasons about names based on a semantic representation and which automatically learns bug detectors instead of manually writing them. We formulate bug detection as a binary classification problem and train a classifier that distinguishes correct from incorrect code. To address the challenge that effectively learning a bug detector requires examples of both correct and incorrect code, we create likely incorrect code examples from an existing corpus of code through simple code transformations. A novel insight learned from our work is that learning from artificially seeded bugs yields bug detectors that are effective at finding bugs in real-world code. We implement our idea into a framework for learning-based and name-based bug detection. Three bug detectors built on top of the framework detect accidentally swapped function arguments, incorrect binary operators, and incorrect operands in binary operations. Applying the approach to a corpus of 150,000 JavaScript files yields bug detectors that have a high accuracy (between 89% and 95%), are very efficient (less than 20 milliseconds per analyzed file), and reveal 102 programming mistakes (with 68% true positive rate) in real-world code.
Key facts. Cited by 65 papers in the map (data through 14 Oct 2026). First posted on arXiv 30 Apr 2018.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 18; 2022: 20; 2023: 14; 2024: 7; 2025: 4; 2026: 2.
65 papers.
Sort:
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 194
- 2021Differentiable Learning Under Triagecited by 76
- 2021Break-It-Fix-It: Unsupervised Learning for Program Repaircited by 71
- 2021Self-Supervised Bug Detection and Repaircited by 59
- 2022On the Transferability of Pre-trained Language Models for Low-Resource Programming Languagescited by 30
- 2021Counterfactual Explanations for Models of Codecited by 25
- 2021A Survey on Machine Learning Techniques for Source Code Analysiscited by 24
- 2021Generating Adversarial Computer Programs using Optimized Obfuscationscited by 22
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2022Deep Learning Meets Software Engineering: A Survey on Pre-Trained Models of Source Codecited by 21
38 more
- 2024MdEval: Massively Multilingual Code Debuggingcited by 16
- 2022On Distribution Shift in Learning-based Bug Detectorscited by 15
- 2022AEON: A Method for Automatic Evaluation of NLP Test Casescited by 15
- 2022Learning to Reduce False Positives in Analytic Bug Detectorscited by 12
- 2022An Exploratory Study on Code Attention in BERTcited by 12
- 2021DeepCVA: Automated Commit-level Vulnerability Assessment with Deep Multi-task Learningcited by 11
- 2021VarCLR: Variable Semantic Representation Pre-training via Contrastive Learningcited by 11
- 2022Static Prediction of Runtime Errors by Learning to Execute Programs with External Resource Descriptionscited by 11
- 2025A Contemporary Survey of Large Language Model Assisted Program Analysiscited by 11
- 2022Improving Automated Program Repair with Domain Adaptationcited by 10
- 2023kTrans: Knowledge-Aware Transformer for Binary Code Embeddingcited by 10
- 2021SYNFIX: Automatically Fixing Syntax Errors using Compiler Diagnosticscited by 8
- 2023LExecutor: Learning-Guided Executioncited by 7
- 2023FLAG: Finding Line Anomalies (in code) with Generative AIcited by 7
- 2024DeepCode AI Fix: Fixing Security Vulnerabilities with Large Language Modelscited by 7
- 2024An Empirical Study on Capability of Large Language Models in Understanding Code Semanticscited by 7
- 2022MetaTPTrans: A Meta Learning Approach for Multilingual Code Representation Learningcited by 6
- 2021Software Vulnerability Detection via Deep Learning over Disaggregated Code Graph Representationcited by 5
- 2022Follow-up Attention: An Empirical Study of Developer and Neural Model Code Explorationcited by 5
- 2023Learning Defect Prediction from Unrealistic Datacited by 5
- 2025IFEvalCode: Controlled Code Generationcited by 5
- 2021Learning to Make Compiler Optimizations More Effectivecited by 4
- 2022Can we learn from developer mistakes? Learning to localize and repair real bugs from real bug fixescited by 4
- 2023Multi-Granularity Detector for Vulnerability Fixescited by 4
- 2021Senatus -- A Fast and Accurate Code-to-Code Recommendation Enginecited by 3
- 2022AdaptivePaste: Code Adaptation through Learning Semantics-aware Variable Usage Representationscited by 3
- 2023What are the Machine Learning best practices reported by practitioners on Stack Exchange?cited by 3
- 2023Automated Testing and Improvement of Named Entity Recognition Systemscited by 3
- 2022Leveraging Structural Properties of Source Code Graphs for Just-In-Time Bug Predictioncited by 2
- 2022JEMMA: An Extensible Java Dataset for ML4Code Applicationscited by 2
- 2023DSHGT: Dual-Supervisors Heterogeneous Graph Transformer -- A pioneer study of using heterogeneous graph learning for detecting software vulnerabilitiescited by 2
- 2023Transfer Attacks and Defenses for Large Language Models on Coding Taskscited by 2
- 2024Towards Non-Adversarial Algorithmic Recoursecited by 2
- 2024Genetic Auto-prompt Learning for Pre-trained Code Intelligence Language Modelscited by 2
- 2021Data-Driven AI Model Signal-Awareness Enhancement and Introspectioncited by 1
- 2021Energy-bounded Learning for Robust Models of Codecited by 1
- 2022LAMNER: Code Comment Generation Using Character Language Model and Named Entity Recognitioncited by 1
- 2023An Exploratory Literature Study on Sharing and Energy Use of Language Models for Source Codecited by 1
50 most cited of 65 All 65 (JSON)
- 2026JupOtter: Cell-Level Bug Detection in Jupyter Notebooks22 Jun 2026
- 2026Benchmarking Zero-Shot Reasoning Approaches for Error Detection in Solidity Smart Contracts17 Feb 2026
- 2025SoK: Understanding (New) Security Issues Across AI4Code Use Cases20 Dec 2025
- 2025IFEvalCode: Controlled Code Generation30 Jul 2025
- 2025Cluster Purge Loss: Structuring Transformer Embeddings for Equivalent Mutants Detection26 Jul 2025
- 2025A Contemporary Survey of Large Language Model Assisted Program Analysis5 Feb 2025
- 2024MdEval: Massively Multilingual Code Debugging4 Nov 2024
- 2024An Empirical Study on Capability of Large Language Models in Understanding Code Semantics4 Jul 2024
- 2024A Systematic Literature Review on the Use of Machine Learning in Software Engineering19 Jun 2024
- 2024Variables are a Curse in Software Vulnerability Prediction18 Jun 2024
- 2024Genetic Auto-prompt Learning for Pre-trained Code Intelligence Language Models20 Mar 2024
- 2024Towards Non-Adversarial Algorithmic Recourse15 Mar 2024
38 more
- 2024DeepCode AI Fix: Fixing Security Vulnerabilities with Large Language Models19 Feb 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023Transfer Attacks and Defenses for Large Language Models on Coding Tasks22 Nov 2023
- 2023Learning Defect Prediction from Unrealistic Data2 Nov 2023
- 2023kTrans: Knowledge-Aware Transformer for Binary Code Embedding24 Aug 2023
- 2023Automated Testing and Improvement of Named Entity Recognition Systems14 Aug 2023
- 2023An Empirical Study on Bugs Inside PyTorch: A Replication Study25 Jul 2023
- 2023Graph Neural Networks For Mapping Variables Between Programs -- Extended Version24 Jul 2023
- 2023An Exploratory Literature Study on Sharing and Energy Use of Language Models for Source Code5 Jul 2023
- 2023FLAG: Finding Line Anomalies (in code) with Generative AI22 Jun 2023
- 2023DSHGT: Dual-Supervisors Heterogeneous Graph Transformer -- A pioneer study of using heterogeneous graph learning for detecting software vulnerabilities2 Jun 2023
- 2023Multi-Granularity Detector for Vulnerability Fixes23 May 2023
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generation13 Feb 2023
- 2023LExecutor: Learning-Guided Execution5 Feb 2023
- 2023What are the Machine Learning best practices reported by practitioners on Stack Exchange?25 Jan 2023
- 2022Improving Automated Program Repair with Domain Adaptation21 Dec 2022
- 2022JEMMA: An Extensible Java Dataset for ML4Code Applications18 Dec 2022
- 2022Ruby: Unmasking Unsafe Rust in Stripped Binaries via Machine Learning31 Oct 2022
- 2022Follow-up Attention: An Empirical Study of Developer and Neural Model Code Exploration11 Oct 2022
- 2022Infrared: A Meta Bug Detector18 Sep 2022
- 2022Code Compliance Assessment as a Learning Problem10 Sep 2022
- 2022Can we learn from developer mistakes? Learning to localize and repair real bugs from real bug fixes1 Jul 2022
- 2022MetaTPTrans: A Meta Learning Approach for Multilingual Code Representation Learning13 Jun 2022
- 2022Deep Learning Meets Software Engineering: A Survey on Pre-Trained Models of Source Code24 May 2022
- 2022AdaptivePaste: Code Adaptation through Learning Semantics-aware Variable Usage Representations23 May 2022
- 2022AEON: A Method for Automatic Evaluation of NLP Test Cases13 May 2022
- 2022CV4Code: Sourcecode Understanding via Visual Code Representations11 May 2022
- 2022On Distribution Shift in Learning-based Bug Detectors21 Apr 2022
- 2022Example-based Synthesis of Static Analysis Rules19 Apr 2022
- 2022An Exploratory Study on Code Attention in BERT5 Apr 2022
- 2022LAMNER: Code Comment Generation Using Character Language Model and Named Entity Recognition5 Apr 2022
- 2022On the Transferability of Pre-trained Language Models for Low-Resource Programming Languages5 Apr 2022
- 2022Learning to Reduce False Positives in Analytic Bug Detectors8 Mar 2022
- 2022Static Prediction of Runtime Errors by Learning to Execute Programs with External Resource Descriptions7 Mar 2022
- 2022Leveraging Structural Properties of Source Code Graphs for Just-In-Time Bug Prediction25 Jan 2022
- 2021Energy-bounded Learning for Robust Models of Code20 Dec 2021
- 2021VarCLR: Variable Semantic Representation Pre-training via Contrastive Learning5 Dec 2021
- 2021Data-Driven AI Model Signal-Awareness Enhancement and Introspection10 Nov 2021
50 newest of 65 All 65 (JSON)
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 194
- 2021Differentiable Learning Under Triagecited by 76
- 2021Break-It-Fix-It: Unsupervised Learning for Program Repaircited by 71
- 2021Self-Supervised Bug Detection and Repaircited by 59
- 2022On the Transferability of Pre-trained Language Models for Low-Resource Programming Languagescited by 30
- 2021Counterfactual Explanations for Models of Codecited by 25
- 2021A Survey on Machine Learning Techniques for Source Code Analysiscited by 24
- 2021Generating Adversarial Computer Programs using Optimized Obfuscationscited by 22
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2022Deep Learning Meets Software Engineering: A Survey on Pre-Trained Models of Source Codecited by 21
12 most cited of 65 All 65 (JSON)
- 2026JupOtter: Cell-Level Bug Detection in Jupyter Notebooks22 Jun 2026
- 2026Benchmarking Zero-Shot Reasoning Approaches for Error Detection in Solidity Smart Contracts17 Feb 2026
- 2025SoK: Understanding (New) Security Issues Across AI4Code Use Cases20 Dec 2025
- 2025IFEvalCode: Controlled Code Generation30 Jul 2025
- 2025Cluster Purge Loss: Structuring Transformer Embeddings for Equivalent Mutants Detection26 Jul 2025
- 2025A Contemporary Survey of Large Language Model Assisted Program Analysis5 Feb 2025
- 2024MdEval: Massively Multilingual Code Debugging4 Nov 2024
- 2024An Empirical Study on Capability of Large Language Models in Understanding Code Semantics4 Jul 2024
- 2024A Systematic Literature Review on the Use of Machine Learning in Software Engineering19 Jun 2024
- 2024Variables are a Curse in Software Vulnerability Prediction18 Jun 2024
- 2024Genetic Auto-prompt Learning for Pre-trained Code Intelligence Language Models20 Mar 2024
- 2024Towards Non-Adversarial Algorithmic Recourse15 Mar 2024
12 newest of 65 All 65 (JSON)