The Power of Types: Exploring the Impact of Type Checking on Neural Bug Detection in Dynamically Typed Languages
Not on the map. Why?
Abstract (arXiv)
Motivation: Automated bug detection in dynamically typed languages such as Python is essential for maintaining code quality. The lack of mandatory type annotations in such languages can lead to errors that are challenging to identify early with traditional static analysis tools. Recent progress in deep neural networks has led to increased use of neural bug detectors. In statically typed languages, a type checker is integrated into the compiler and thus taken into consideration when the neural bug detector is designed for these languages. Problem: However, prior studies overlook this aspect during the training and testing of neural bug detectors for dynamically typed languages. When an optional type checker is used, assessing existing neural bug detectors on bugs easily detectable by type checkers may impact their performance estimation. Moreover, including these bugs in the training set of neural bug detectors can shift their detection focus toward the wrong type of bugs. Contribution: We explore the impact of type checking on various neural bug detectors for variable misuse bugs, a common type targeted by neural bug detectors. Existing synthetic and real-world datasets are type-checked to evaluate the prevalence of type-related bugs. Then, we investigate how type-related bugs influence the training and testing of the neural bug detectors. Findings: Our findings indicate that existing bug detection datasets contain a significant proportion of type-related bugs. Building on this insight, we discover integrating the neural bug detector with a type checker can be beneficial, especially when the code is annotated with types. Further investigation reveals neural bug detectors perform better on type-related bugs than other bugs. Moreover, removing type-related bugs from the training data helps improve neural bug detectors' ability to identify bugs beyond the scope of type checkers.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 12 of its 55 references that are in the map. First posted on arXiv 22 Nov 2024.
Builds on
12 of 55 references.
References · 12
- 2017Attention Is All You Needcited by 60,361
- 2016Semi-Supervised Classification with Graph Convolutional Networkscited by 11,361
- 2015Gated Graph Sequence Neural Networkscited by 796
- 2017Learning to Represent Programs with Graphscited by 220
- 2020Graph-based, Self-Supervised Program Repair from Diagnostic Feedbackcited by 94
- 2019Neural Program Repair by Jointly Learning to Localize and Repaircited by 40
- 2022On Distribution Shift in Learning-based Bug Detectorscited by 15
- 2020OptTyper: Probabilistic Type Inference by Optimising Logical and Natural Constraintscited by 14
- 2023TypeT5: Seq2seq Type Inference using Static Analysiscited by 12
- 2019Neural Bug Finding: A Study of Opportunities and Challengescited by 6
- 2023Type Prediction With Program Decomposition and Fill-in-the-Type Trainingcited by 6
- 2023Learning Defect Prediction from Unrealistic Datacited by 5
Built on by
Citing papers per year: 2026: 1.
1 paper.