Large Language Models (LLMs) have demonstrated remarkable potential in automated code generation. However, existing test-driven code generation and refinement frameworks are often hindered by the tests' quality: they typically treat self-generated tests as ground truth, leading to ineffective debugging loops where code is modified to satisfy erroneous tests. To address this, we propose BiVCoder, a diagnosis-driven multi-agent framework featuring a novel bidirectional code-test diagnosis mechanism. BiVCoder coordinates three specialized agents—Coding Agent, Test Agent, and Review Agent. Central to this architecture is the Review Agent, which serves as a diagnosis and decision-making hub. By integrating an MCP-based code-test execution tool, the Review Agent rigorously executes programs to diagnose failure root causes, distinguishing between implementation bugs and test case deficiencies, and subsequently triggers targeted repairs (Coding Agent or Test Agent). Furthermore, we introduce BiVCoder-SFT, a role-specific instruction fine-tuning scheme. We construct high-quality datasets to fine-tune the Qwen3-4B base model into specialized agents for coding, testing, and reviewing. Extensive experiments on HumanEval, MBPP, and their rigorous ''ET'' variants demonstrate the superiority of our approach. With GPT-3.5, BiVCoder achieves a Pass@1 of 77.3%. Notably, the specialized BiVCoder-SFT achieves an average score of 79.5% across the four datasets, not only outperforming its base model (69.7%) but also surpassing larger general-purpose models such as Qwen3-8B (77.8%). Additionally, BiVCoder boosts the performance of more powerful models, improving DeepSeek-V3.2 from 87.2% to 92.1% on HumanEval.
Xiaoyang Li, Jinhao Dong, Wenhang Shi et al.· Proceedings of the 32nd ACM...· 0 citations
Relational Database Management Systems (RDBMSs) are the backbone of modern data-intensive applications, making reliability and robustness critical. However, achieving high coverage in RDBMS testing remains challenging because of large codebases and complex execution logic. Traditional fuzzing relies on random SQL generation and cannot capture the correspondence between SQL inputs and internal execution paths, while symbolic execution suffers from prohibitive cost and scalability limitations. We propose DBcover, an LLM-driven white-box SQL test generation framework based on contextual reasoning. DBcover uses lightweight dynamic analysis to extract SQL-to-path correspondence and call graphs as global context, and collects source-level information around target functions as local context. These contexts are organized in a unified knowledge graph for efficient retrieval and reuse. DBcover then performs two-phase test generation: it first selects a semantically relevant seed whose execution path is close to the uncovered target, and then guides the LLM with global and local context to generate SQL test cases that trigger previously uncovered code regions. Experiments show that DBcover achieves 80.1% and 82.3% coverage on PostgreSQL and MySQL, and is also effective on the enterprise RDBMS KingbaseES, demonstrating its practical applicability to closed-source systems.
Yan-Kai Rong, Shuang Liu, Jinhao Dong et al.· 0 citations