EUVIMEDPoznaj EUVIMED
Open access · CC BY 4.0

A Learning-Based Approach to Static Program Slicing

Aashish Yadavally, Yi Li, Shaohua Wang, Tien N. Nguyen

Proceedings of the ACM on Programming Languages · 2024-04-29 · 8 (OOPSLA1) · 83-109

DOI: 10.1145/3649814 ↗

At a glance

Journal article in Proceedings of the ACM on Programming Languages, published online on 2024-04-29. Written by Aashish Yadavally and 3 co-authors. Cited 22 times so far (Crossref); 52 references. The full text is freely available (open access, CC BY 4.0). Funded by: National Science Foundation, National Security Agency.

AbstraktDane bibliograficzneCiteRelated studies

Abstract (original language)

Traditional program slicing techniques are crucial for early bug detection and manual/automated debugging of 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 the 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.

Funding

  • National Science Foundation
  • National Security Agency

Cite

APA

Yadavally, A., Li, Y., Wang, S., & Nguyen, T. N. (2024). A Learning-Based Approach to Static Program Slicing. Proceedings of the ACM on Programming Languages, 8(OOPSLA1), 83-109. https://doi.org/10.1145/3649814

Vancouver

Yadavally A, Li Y, Wang S, Nguyen TN. A Learning-Based Approach to Static Program Slicing. Proceedings of the ACM on Programming Languages. 2024;8(OOPSLA1):83-109. doi:10.1145/3649814

BibTeX
@article{Yadavally2024,
  author = {Yadavally, Aashish and Li, Yi and Wang, Shaohua and Nguyen, Tien N.},
  title = {A Learning-Based Approach to Static Program Slicing},
  journal = {Proceedings of the ACM on Programming Languages},
  year = {2024},
  volume = {8},
  number = {OOPSLA1},
  pages = {83--109},
  doi = {10.1145/3649814}
}
Start for free →