A statistical approach for finding property-access errors
Ellen Arteca, Max Sch\"afer, Frank Tip

TL;DR
This paper presents a statistical method to detect property-access errors in JavaScript by analyzing real-world code patterns and filtering out safe anomalies, achieving high precision and recall in identifying actual bugs.
Contribution
It introduces a two-phase approach combining statistical analysis and data-flow filtering to effectively identify property-access errors in dynamic JavaScript objects.
Findings
Achieves 82% precision and 90% recall in detecting property-access errors.
VSCode code completion has 100% precision but only 22.5% recall for suggesting correct properties.
The approach is practical and suitable for real-world debugging.
Abstract
We study the problem of finding incorrect property accesses in JavaScript where objects do not have a fixed layout, and properties (including methods) can be added, overwritten, and deleted freely throughout the lifetime of an object. Since referencing a non-existent property is not an error in JavaScript, accidental accesses to non-existent properties (caused, perhaps, by a typo or by a misunderstanding of API documentation) can go undetected without thorough testing, and may manifest far from the source of the problem. We propose a two-phase approach for detecting property access errors based on the observation that, in practice, most property accesses will be correct. First a large number of property access patterns is collected from an extensive corpus of real-world JavaScript code, and a statistical analysis is performed to identify anomalous usage patterns. Specific instances of…
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.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Web Application Security Vulnerabilities · Software Reliability and Analysis Research
