Lune

ISSTA2026顶会

ConUT: Condition-Aware Test Generation for Complex Java Code

Ruiguo Yu, Ruiqi Dong, Xi Xiao, Xiaogang Zhu, Shaohua Wang, Sheng Wen, Qing Li

摘要

Automatically generating high-coverage unit tests for complex Java methods remains a formidable challenge, particularly when execution paths are guarded by intricate control-flow nesting and cross-class state dependencies. Existing LLM-based approaches predominantly follow a goal-driven paradigm , relying on unguided code synthesis within a vast search space to satisfy coverage objectives. Lacking explicit guidance on how to construct the precise object states required for complex predicates, these methods suffer from a construction-reachability gap, ultimately resulting in insufficient coverage for complex methods. This paper introduces ConUT, a condition-aware unit test generation framework centered on the paradigm of Configuration-Driven Guidance, which is a strategy that bridges the gap between abstract branch targets and concrete code realization by providing the LLM with structured instantiation recipes. Our core insight is that the implicit causal chain leading to a target branch can be explicitly manifested via static analysis and distilled into structured guidance. ConUT utilizes Backward Dependency Tracing (BDT) to identify the fields and method calls that influence predicates, and distills these findings into structured Configuration Templates ( C cfg ). These templates serve as a “semantic roadmap,” pruning the LLM’s search space and transitioning it from a stochastic generator into a guided logic realizer. We evaluate ConUT on eight real-world Java projects characterized by high-complexity “logic hotspots.” Experimental results demonstrate that ConUT outperforms state-of-the-art baselines, achieving an average branch coverage of 72.84% and line coverage of 83.87%. Notably, ConUT exceeds the best baseline in average branch coverage by 11.94 percentage points while utilizing 67% fewer test cases.

问 Lune

几分钟看清这篇 Paper 的位置,不用再花一下午。

Lune 能读引用它和与它最相关的顶会 Paper,讲清它说了什么、后来怎样、哪里站不住,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

摘要 · 相关的 Paper

获取答案

免费开始,无需绑卡

相关 Paper

  1. Navigating the Labyrinth: Path-Sensitive Unit Test Generation with Large Language ModelsDianshu Liao, Xin Yin, Shidong Pan, Chao Ni 等ASE 2025 · 2 次引用
  2. LLM Test Generation via Iterative Hybrid Program AnalysisSijia Gu, Noor Nashid, Ali MesbahICSE 2026 · 6 次引用
  3. Context Matters: Improving the Practical Reliability of LLM-Based Unit Test Generation (Experience Paper)Junjie Chen, Ziqi Wang, Lin Yang, Chen Yang 等ISSTA 2026
  4. TestTailor: Generating High-Coverage Tests via Path-Proximal Tests with LLMsXiaoxuan Zhou, Yiling Lou, Jinhao Dong, Dan HaoFSE 2026
  5. HITS: High-coverage LLM-based Unit Test Generation via Method SlicingZejun Wang, Kaibo Liu, Ge Li, Zhi JinASE 2024 · 29 次引用
黄昏的海面,两侧是细线勾勒的悬崖