Lune

ASE2024顶会

HITS: High-coverage LLM-based Unit Test Generation via Method Slicing

Zejun Wang, Kaibo Liu, Ge Li, Zhi Jin

摘要

Large language models (LLMs) have behaved well in generating unit tests for Java projects. However, the performance for covering the complex focal methods within the projects is poor. Complex methods comprise many conditions and loops, requiring the test cases to be various enough to cover all lines and branches. However, existing test generation methods with LLMs provide the whole method-to-test to the LLM without assistance on input analysis. The LLM has difficulty inferring the test inputs to cover all conditions, resulting in missing lines and branches. To tackle the problem, we propose decomposing the focal methods into slices and asking the LLM to generate test cases slice by slice. Our method simplifies the analysis scope, making it easier for the LLM to cover more lines and branches in each slice. We build a dataset comprising complex focal methods collected from the projects used by existing state-ofthe-art approaches. Our experiment results show that our method significantly outperforms current test case generation methods with LLMs and the typical SBST method Evosuite regarding both line and branch coverage scores.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 22 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Knowledge Matters: Injecting Project and Testing Knowledge into LLM-based Unit Test Generation 引用了 CodaMosa: Escaping Coverage Plateaus in Test Generation with Pre-trained Large Language Models
  • Knowledge Matters: Injecting Project and Testing Knowledge into LLM-based Unit Test Generation 引用了 Code-Aware Prompting: A Study of Coverage-Guided Test Generation in Regression Setting using LLM
  • LLM Test Generation via Iterative Hybrid Program Analysis 引用了 CodaMosa: Escaping Coverage Plateaus in Test Generation with Pre-trained Large Language Models
  • LLM Test Generation via Iterative Hybrid Program Analysis 引用了 CAT-LM Training Language Models on Aligned Code And Tests
  • LLM Test Generation via Iterative Hybrid Program Analysis 引用了 Code-Aware Prompting: A Study of Coverage-Guided Test Generation in Regression Setting using LLM
  • Unit Test Update through LLM-Driven Context Collection and Error-Type-Aware Refinement 引用了 Code-Aware Prompting: A Study of Coverage-Guided Test Generation in Regression Setting using LLM
  • Teaching Large Language Models to Self-Debug 引用了 Self-Refine: Iterative Refinement with Self-Feedback
  • Code-Aware Prompting: A Study of Coverage-Guided Test Generation in Regression Setting using LLM 引用了 CodaMosa: Escaping Coverage Plateaus in Test Generation with Pre-trained Large Language Models
  • UTFix: Change Aware Unit Test Repairing using LLM 引用了 Code-Aware Prompting: A Study of Coverage-Guided Test Generation in Regression Setting using LLM
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper22

  1. UTFix: Change Aware Unit Test Repairing using LLMShanto Rahman, Sachit Kuhar, Berk Çirisci, Pranav Garg 等OOPSLA 2025 · 9 次引用
  2. LLM Test Generation via Iterative Hybrid Program AnalysisSijia Gu, Noor Nashid, Ali MesbahICSE 2026 · 6 次引用
  3. FidelityGPT: Correcting Decompilation Distortions with Retrieval Augmented GenerationZhiping Zhou, Xiaohong Li, Ruitao Feng, Yao Zhang 等NDSS 2026 · 5 次引用
  4. Unit Test Update through LLM-Driven Context Collection and Error-Type-Aware RefinementYuanhe Zhang, Zhiquan Yang, Shengyi Pan, Zhongxin LiuASE 2025 · 3 次引用
  5. Knowledge Matters: Injecting Project and Testing Knowledge into LLM-based Unit Test GenerationAnji Li, Mingwei Liu, Zhenxi Chen, Zheng Pei 等ICSE 2026 · 2 次引用

它引用的 Paper6

  1. Self-Refine: Iterative Refinement with Self-FeedbackAman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan 等NeurIPS 2023 · 4,972 次引用
  2. Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 次引用
  3. CodaMosa: Escaping Coverage Plateaus in Test Generation with Pre-trained Large Language ModelsCaroline Lemieux, Jeevana Priya Inala, Shuvendu K. Lahiri, Siddhartha SenICSE 2023 · 221 次引用
  4. Code-Aware Prompting: A Study of Coverage-Guided Test Generation in Regression Setting using LLMGabriel Ryan, Siddhartha Jain, Mingyue Shang, Shiqi Wang 等FSE 2024 · 68 次引用
  5. CAT-LM Training Language Models on Aligned Code And TestsNikitha Rao, Kush Jain, Uri Alon, Claire Le Goues 等ASE 2023 · 37 次引用

相关 Paper

  1. Do LLMs Generate Useful Test Oracles? An Empirical Study with an Unbiased DatasetDavide Molinelli, Luca Di Grazia, Alberto Martin-Lopez, Michael D. Ernst 等ASE 2025 · 3 次引用
  2. On the Evaluation of Large Language Models in Unit Test GenerationLin Yang, Chen Yang, Shutao Gao, Weijing Wang 等ASE 2024 · 42 次引用
  3. Navigating the Labyrinth: Path-Sensitive Unit Test Generation with Large Language ModelsDianshu Liao, Xin Yin, Shidong Pan, Chao Ni 等ASE 2025 · 2 次引用
  4. Test Intention Guided LLM-Based Unit Test GenerationZifan Nan, Zhaoqiang Guo, Kui Liu, Xin XiaICSE 2025 · 5 次引用
  5. TOGLL: Correct and Strong Test Oracle Generation with LLMSSoneya Binta Hossain, Matthew B. DwyerICSE 2025 · 12 次引用
黄昏的海面,两侧是细线勾勒的悬崖