Dual-Phase Agent Decomposition for Automated Unit Test Generation in C Programs
Authors: J. M. Chowdhury*, F. Oscar*, & R. Jabbarvand
Under Preparation
This work presents a novel agentic framework for automated generation of behavior-driven unit tests for C programs using AI Agents, ensuring comprehensive coverage of functional scenarios. We propose an agent decomposition strategy, designing a dual-phase framework that decouples high-level reasoning about program behavior (System 2) from concrete test code generation (System 1), addressing limitations of monolithic AI Agents. The framework implements a neuro-symbolic algorithm to generate program control flow representations in the reasoning phase, isolating model understanding from surface-level generation errors and achieving 2x improvement in code coverage over standard monolithic agents. We evaluated advanced testing tools including KLEE for symbolic execution and AFL++ for fuzzing, identifying their limitations in test generation.
* denotes equal contribution
