Program Slicing in the Era of Large Language Models
Kimya Khakzad Shahandashti, Mohammad Mahdi Mohajer, Alvine Boaye, Belle, Song Wang, Hadi Hemmati

TL;DR
This paper explores the application of large language models to program slicing in Java, evaluating their performance and identifying failure causes, with strategies to enhance accuracy through improved prompting techniques.
Contribution
It provides a comprehensive evaluation of LLMs for static and dynamic program slicing and introduces prompting strategies to improve their performance.
Findings
GPT-4o achieves the highest accuracy among tested LLMs.
LLMs currently have limited performance in program slicing tasks.
Prompting strategies can improve LLM accuracy by up to 4%.
Abstract
Program slicing is a critical technique in software engineering, enabling developers to isolate relevant portions of code for tasks such as bug detection, code comprehension, and debugging. In this study, we investigate the application of large language models (LLMs) to both static and dynamic program slicing, with a focus on Java programs. We evaluate the performance of four state-of-the-art LLMs- GPT-4o, GPT-3.5 Turbo, Llama-2, and Gemma-7B leveraging advanced prompting techniques, including few-shot learning and chain-of-thought reasoning. Using a dataset of 100 Java programs derived from LeetCode problems, our experiments reveal that GPT-4o performs the best in both static and dynamic slicing across other LLMs, achieving an accuracy of 60.84% and 59.69%, respectively. Our results also show that the LLMs we experimented with are yet to achieve reasonable performance for either static…
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 · Software Testing and Debugging Techniques · Scientific Computing and Data Management
