SPARC: Scenario Planning and Reasoning for Automated C Unit Test Generation
Jaid Monwar Chowdhury, Chi-An Fu, Reyhaneh Jabbarvand

TL;DR
SPARC is a neuro-symbolic framework that enhances automated C unit test generation by integrating program analysis, LLM reasoning, and iterative validation, significantly improving coverage and test quality.
Contribution
It introduces a novel scenario-based, neuro-symbolic approach that bridges the semantic gap in LLM-driven C test generation, outperforming baseline methods and existing tools.
Findings
31.36% increase in line coverage
26.01% increase in branch coverage
94.3% test retention after repair
Abstract
Automated unit test generation for C remains a formidable challenge due to the semantic gap between high-level program intent and the rigid syntactic constraints of pointer arithmetic and manual memory management. While Large Language Models (LLMs) exhibit strong generative capabilities, direct intent-to-code synthesis frequently suffers from the leap-to-code failure mode, where models prematurely emit code without grounding in program structure, constraints, and semantics. This will result in non-compilable tests, hallucinated function signatures, low branch coverage, and semantically irrelevant assertions that cannot properly capture bugs. We introduce SPARC, a neuro-symbolic, scenario-based framework that bridges this gap through four stages: (1) Control Flow Graph (CFG) analysis, (2) an Operation Map that grounds LLM reasoning in validated utility helpers, (3) Path-targeted test…
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 Testing and Debugging Techniques · Model-Driven Software Engineering Techniques · Software Engineering Research
