Context2Name: A Deep Learning-Based Approach to Infer Natural Variable Names from Usage Contexts
Rohan Bavishi, Michael Pradel, Koushik Sen

TL;DR
Context2Name is a deep learning method that predicts meaningful variable names from usage contexts in minified JavaScript code, improving interpretability and reversing minification effects efficiently.
Contribution
It introduces a novel deep learning approach combining static analysis and neural networks to predict natural variable names, outperforming existing tools in accuracy and efficiency.
Findings
Predicts 47.5% of minified identifiers correctly
Operates with an average prediction time of 2.9 ms
Outperforms state-of-the-art tools JSNice and JSNaughty in accuracy and efficiency
Abstract
Most of the JavaScript code deployed in the wild has been minified, a process in which identifier names are replaced with short, arbitrary and meaningless names. Minified code occupies less space, but also makes the code extremely difficult to manually inspect and understand. This paper presents Context2Name, a deep learningbased technique that partially reverses the effect of minification by predicting natural identifier names for minified names. The core idea is to predict from the usage context of a variable a name that captures the meaning of the variable. The approach combines a lightweight, token-based static analysis with an auto-encoder neural network that summarizes usage contexts and a recurrent neural network that predict natural names for a given usage context. We evaluate Context2Name with a large corpus of real-world JavaScript code and show that it successfully predicts…
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 · Topic Modeling · Web Data Mining and Analysis
