Traditional program slicing techniques are crucial for early bug detection and manual/automated debugging for online code snippets. Nevertheless, their inability to handle incomplete code hinders their real-world applicability in such scenarios. To overcome these challenges, we present NS-Slicer, a novel learning-based approach that predicts static program slices for both complete and partial code. Our tool leverages a pre-trained language model to exploit its understanding of fine-grained variable-statement dependencies within source code. With this knowledge, given a variable at a specific location and a statement in a code snippet, NS-Slicer determines whether the statement belongs to the backward slice or forward slice, respectively.
We conducted a series of experiments to evaluate NS-Slicer’s performance. On complete code, it predicts the backward and forward slices with an F1-score of 97.41% and 95.82%, respectively, while achieving an overall F1-score of 96.77%. Notably, in 85.20% of the cases, the static program slices predicted by NS-Slicer exactly match entire slices from the oracle. For partial programs, it achieved an F1-score of 96.77%–97.49% for backward slicing, 92.14%–95.40% for forward slicing, and an overall F1-score of 94.66%–96.62%. Furthermore, we demonstrate NS-Slicer’s utility in vulnerability detection (VD), integrating its predicted slices into an automated VD tool. In this setup, the tool detected vulnerabilities in Java code with a high F1-score of 73.38%. We also include analyses studying NS-Slicer’s promising performance and limitations, providing insights into its understanding of intrinsic code properties such as variable aliasing, leading to better slicing.
Fri 25 OctDisplayed time zone: Pacific Time (US & Canada) change
11:00 - 12:20 | Static Analysis and Program Verification 4OOPSLA 2024 at IBR West Chair(s): Anders Møller Aarhus University | ||
11:00 20mTalk | A Learning-Based Approach to Static Program Slicing OOPSLA 2024 Aashish Yadavally University of Texas at Dallas, Yi Li University of Texas at Dallas, Shaohua Wang Central University of Finance and Economics, Tien N. Nguyen University of Texas at Dallas DOI Pre-print | ||
11:20 20mTalk | Boosting the Performance of Alias-Aware IFDS Analysis with CFL-based Environment Transformers OOPSLA 2024 Haofeng Li Institute of Computing Technology at Chinese Academy of Sciences, Chenghang Shi SKLP, Institute of Computing Technology, CAS, Jie Lu SKLP, Institute of Computing Technology, CAS, Lian Li Institute of Computing Technology at Chinese Academy of Sciences; University of Chinese Academy of Sciences, Jingling Xue UNSW Sydney DOI | ||
11:40 20mTalk | The ART of Sharing Points-to Analysis: Reusing Points-to Analysis Results Safely and Efficiently OOPSLA 2024 Shashin Halalingaiah UT Austin, IIT Madras, Vijay Sundaresan IBM Canada, Daryl Maier IBM Canada, V Krishna Nandivada IIT Madras DOI | ||
12:00 20mTalk | UniSparse: An Intermediate Language for General Sparse Format Customization OOPSLA 2024 Jie Liu Cornell University, Zhongyuan Zhao Qualcomm, Zijian Ding UCLA, Benjamin Brock Parallel Computing Lab (PCL), Intel, Hongbo Rong Intel Labs, Zhiru Zhang Cornell University, USA DOI |