[2602.16671] SPARC: Scenario Planning and Reasoning for Automated C Unit Test Generation

[2602.16671] SPARC: Scenario Planning and Reasoning for Automated C Unit Test Generation

arXiv - AI 4 min read Article

Summary

The SPARC framework enhances automated C unit test generation by bridging the gap between program intent and syntactic constraints, improving test coverage and maintainability.

Why It Matters

Automated unit testing is crucial for software reliability, especially in C programming, where manual memory management poses challenges. SPARC's innovative approach could significantly improve testing efficiency and accuracy, making it relevant for software engineers and developers working with legacy codebases.

Key Takeaways

  • SPARC integrates scenario-based reasoning with LLMs to improve unit test generation.
  • It outperforms traditional methods in line coverage, branch coverage, and mutation score.
  • The framework includes a self-correction loop that enhances test quality over time.
  • SPARC is particularly effective for complex C codebases, improving readability and maintainability.
  • This approach aligns AI reasoning with program structures, offering a scalable solution for testing.

Computer Science > Software Engineering arXiv:2602.16671 (cs) [Submitted on 18 Feb 2026] Title:SPARC: Scenario Planning and Reasoning for Automated C Unit Test Generation Authors:Jaid Monwar Chowdhury, Chi-An Fu, Reyhaneh Jabbarvand View a PDF of the paper titled SPARC: Scenario Planning and Reasoning for Automated C Unit Test Generation, by Jaid Monwar Chowdhury and 2 other authors View PDF HTML (experimental) 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 synthesis, and (4) an iterative, self-correction validation loop using compiler and runtime feedback. We evaluate SPARC on 59 real-world and algorithmic subjects, where it outpe...

Related Articles

Llms

main skill in software engineering in 2026 is knowing what to ask Claude, not knowing how to code. and I can’t decide if that’s depressing or just the next abstraction layer.

Been writing code professionally for 8+ years. I’m now mass spending more time describing features in plain english than writing actual c...

Reddit - Artificial Intelligence · 1 min ·
Llms

Can we even achieve AGI with LLMs, why do AI bros still believe we can?

I've heard mixed discussions around this. Although not much evidence just rhetoric from the AGI will come from LLMs camp. submitted by /u...

Reddit - Artificial Intelligence · 1 min ·
Llms

You can now prompt OpenClaw into existence. fully 1st party on top of Claude Code

OpenClaw is basically banned from Claude ¯_(ツ)_/¯ Claude Code has Telegram support.. so what if we just, made it always stay on? turns ou...

Reddit - Artificial Intelligence · 1 min ·
Anthropic Teams Up With Its Rivals to Keep AI From Hacking Everything
Llms

Anthropic Teams Up With Its Rivals to Keep AI From Hacking Everything

The AI lab's Project Glasswing will bring together Apple, Google, and more than 45 other organizations. They'll use the new Claude Mythos...

Wired - AI · 7 min ·
More in Llms: This Week Guide Trending

No comments

No comments yet. Be the first to comment!

Stay updated with AI News

Get the latest news, tools, and insights delivered to your inbox.

Daily or weekly digest • Unsubscribe anytime