Learning how to listen: Automatically finding bug patterns in event-driven JavaScript APIs
Ellen Arteca, Max Sch\"afer, and Frank Tip

TL;DR
This paper presents a learning-based method to detect bug patterns in event-driven JavaScript APIs by mining large code corpora and applying statistical models, effectively identifying anomalous event listener usage.
Contribution
It introduces a novel approach combining static analysis and statistical modeling to detect incorrect event API usage patterns in JavaScript code at scale.
Findings
Detected 75 anomalous patterns with 90.9% precision
Achieved 7.5% recall on validation set
Reported 30 issues in open-source projects, 7 confirmed bugs
Abstract
Event-driven programming is widely practiced in the JavaScript community, both on the client side to handle UI events and AJAX requests, and on the server side to accommodate long-running operations such as file or network I/O. Many popular event-based APIs allow event names to be specified as free-form strings without any validation, potentially leading to lost events for which no listener has been registered and dead listeners for events that are never emitted. In previous work, Madsen et al. presented a precise static analysis for detecting such problems, but their analysis does not scale because it may require a number of contexts that is exponential in the size of the program. Concentrating on the problem of detecting dead listeners, we present an approach to learn how to correctly use event-based APIs by first mining a large corpus of JavaScript code using a simple static analysis…
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 System Performance and Reliability · Web Application Security Vulnerabilities
