Lune

ICSE2026Top-tier venue

LLM Test Generation via Iterative Hybrid Program Analysis

Sijia Gu, Noor Nashid, Ali Mesbah

Abstract

Automating unit test generation remains a significant challenge, particularly for complex methods in real-world projects. While Large Language Models (LLMs) have made strides in code generation, they struggle to achieve high branch coverage due to their limited ability to reason about intricate control flow structures. To address this limitation, we introduce Panta, a technique that emulates the iterative process human developers follow when analyzing code and constructing test cases. Panta integrates static control flow analysis and dynamic code coverage analysis to systematically guide LLMs in identifying uncovered execution paths and generating better test cases. By incorporating an iterative feedbackdriven mechanism, our technique continuously refines test generation based on static and dynamic path coverage insights, ensuring more comprehensive and effective testing. Our empirical evaluation, conducted on classes with high cyclomatic complexity from open-source projects, demonstrates that Panta achieves 26% higher line coverage and 23% higher branch coverage compared to the state-of-the-art.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

4 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • CodaMosa: Escaping Coverage Plateaus in Test Generation with Pre-trained Large Language Models cites On learning meaningful assert statements for unit test cases
  • Navigating the Labyrinth: Path-Sensitive Unit Test Generation with Large Language Models cites On learning meaningful assert statements for unit test cases
  • Navigating the Labyrinth: Path-Sensitive Unit Test Generation with Large Language Models cites Code-Aware Prompting: A Study of Coverage-Guided Test Generation in Regression Setting using LLM
  • Retrieval-Based Prompt Selection for Code-Related Few-Shot Learning cites On learning meaningful assert statements for unit test cases
  • Issue2Test: Generating Reproducing Test Cases from Issue Reports cites CodaMosa: Escaping Coverage Plateaus in Test Generation with Pre-trained Large Language Models
  • Issue2Test: Generating Reproducing Test Cases from Issue Reports cites On learning meaningful assert statements for unit test cases
  • Issue2Test: Generating Reproducing Test Cases from Issue Reports cites Retrieval-Based Prompt Selection for Code-Related Few-Shot Learning
  • Issue2Test: Generating Reproducing Test Cases from Issue Reports cites Code-Aware Prompting: A Study of Coverage-Guided Test Generation in Regression Setting using LLM
  • Issue2Test: Generating Reproducing Test Cases from Issue Reports cites Large Language Models are Few-shot Testers: Exploring LLM-based General Bug Reproduction
  • Code-Aware Prompting: A Study of Coverage-Guided Test Generation in Regression Setting using LLM cites CodaMosa: Escaping Coverage Plateaus in Test Generation with Pre-trained Large Language Models
  • Evaluating LLM-Based Regression Test Generation cites On learning meaningful assert statements for unit test cases
  • Evaluating LLM-Based Regression Test Generation cites Code-Aware Prompting: A Study of Coverage-Guided Test Generation in Regression Setting using LLM
  • Evaluating LLM-Based Regression Test Generation cites Large Language Models are Few-shot Testers: Exploring LLM-based General Bug Reproduction
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. ProtocolGuard: Detecting Protocol Non-compliance Bugs via LLM-guided Static Analysis and Dynamic VerificationXiangpu Song, Longjia Pei, Jianliang Wu, Yingpei Zeng et al.NDSS 2026 · 3 citations
  2. Navigating the Labyrinth: Path-Sensitive Unit Test Generation with Large Language ModelsDianshu Liao, Xin Yin, Shidong Pan, Chao Ni et al.ASE 2025 · 2 citations
  3. Issue2Test: Generating Reproducing Test Cases from Issue ReportsNoor Nashid, Islem Bouzenia, Michael Pradel, Ali MesbahICSE 2026 · 1 citation
  4. Evaluating LLM-Based Regression Test GenerationJing Liu, Seongmin Lee, Eleonora Losiouk, Marcel BöhmeFSE 2026 · 1 citation

Builds on10

  1. CodaMosa: Escaping Coverage Plateaus in Test Generation with Pre-trained Large Language ModelsCaroline Lemieux, Jeevana Priya Inala, Shuvendu K. Lahiri, Siddhartha SenICSE 2023 · 221 citations
  2. Large Language Models are Few-shot Testers: Exploring LLM-based General Bug ReproductionSungmin Kang, Juyeon Yoon, Shin YooICSE 2023 · 163 citations
  3. Retrieval-Based Prompt Selection for Code-Related Few-Shot LearningNoor Nashid, Mifta Sintaha, Ali MesbahICSE 2023 · 156 citations
  4. On learning meaningful assert statements for unit test casesCody Watson, Michele Tufano, Kevin Moran, Gabriele Bavota et al.ICSE 2020 · 96 citations
  5. Code-Aware Prompting: A Study of Coverage-Guided Test Generation in Regression Setting using LLMGabriel Ryan, Siddhartha Jain, Mingyue Shang, Shiqi Wang et al.FSE 2024 · 68 citations

Related papers

  1. HITS: High-coverage LLM-based Unit Test Generation via Method SlicingZejun Wang, Kaibo Liu, Ge Li, Zhi JinASE 2024 · 29 citations
  2. PALM: Synergizing Program Analysis and LLMs to Enhance Rust Unit Test CoverageBei Chu, Yang Feng, Kui Liu, Hange Shi et al.ASE 2025 · 3 citations
  3. TestWeaver: Execution-aware, Feedback-driven Regression Testing Generation with Large Language ModelsCuong Chi Le, Cuong Duc Van, Tung Duy Vu, Minh Vu Thai Pham et al.ICSE 2026 · 1 citation
  4. CoverUp: Effective High Coverage Test Generation for PythonJuan Altmayer Pizzorno, Emery D. BergerFSE 2025 · 13 citations
  5. Knowledge Matters: Injecting Project and Testing Knowledge into LLM-based Unit Test GenerationAnji Li, Mingwei Liu, Zhenxi Chen, Zheng Pei et al.ICSE 2026 · 2 citations
Dusk over the sea between two cliffs drawn in fine vertical lines