← ALB News · curated headline

Test-Centric Code Generation: Enhancing Test Diversity, Reliability, and Utilization

arXiv Software Engineering · WORLD · Compilers · 12/4/2026, 12:00:00 AM

arXiv:2612.05192v1 Announce Type: new Abstract: Large Language Models (LLMs) have made significant progress in code generation, yet the correctness of generated code remains a major challenge, particularly for complex programming tasks. Test-driven code generation offers a promising solution by leveraging automatically generated tests to guide code generation and verification. However, existing approaches often suffer from insufficient test correctness, limited test diversity, and inadequate utilization of test information. To address these limitations, we propose TCG, a test-centric code generation framework comprising three complementary components: Diverse Test Generation, which combines unit tests and property-based tests to improve behavioral coverage; Reliable Test Curation, which employs syntax checking and execution-based cross-validation to identify reliable tests; and Test-Centric Code Generation, which integrates test information into requirement understanding, code verification, and fault repair. We evaluate TCG using three representative LLMs across six function-level and repository-level code generation benchmarks, comparing it with nine representative baselines. Experimental results show that TCG consistently outperforms all applicable baselines across 18 experimental settings, achieving average improvements of 6.63% to 25.59% in Pass@1. These findings demonstrate the effectiveness of leveraging diverse, reliable tests throughout the code generation process.

Continue to arXiv Software Engineering →

Connections

Laws & Congress

Research papers

Finished reading? Continue to the original source above — or join the discussion below.