MineValiCoder: Reliable Code Generation with Test Case Quality Mining and Bipartite Graph-Based Mutual Validation

· Source: cs.SE updates on arXiv.org · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering · Depth: Expert, extended

Summary

MineValiCoder is a novel, fully automated Test-Driven Development (TDD) framework designed to enhance the reliability of Large Language Model (LLM)-based code generation. It tackles the challenges of faulty and mixed-quality LLM-generated test cases, which often mislead code optimization and hinder optimal code selection. The framework integrates three core modules: Test Case Quality Mining (TCQM) for filtering unreliable test cases through self-validation; Parallel TDD Refinement for iteratively optimizing code and generating diverse candidates; and Bipartite Graph-Based Code-Test Mutual Validation (BiCoTeV) for dynamically modeling code-test interactions to select the best code. Evaluated across four LLMs, including GPT-4, Llama3.1-8B, Qwen2.5-Coder-7B, and Qwen3-4B, MineValiCoder achieved Pass@1 scores of 96.34% on HumanEval, 87.40% on MBPP, 64.00% on APPS, and 51.33% on LiveCodeBench, significantly outperforming existing methods and approaching the performance of human-crafted test cases.

Key takeaway

For AI Engineers focused on reliable code generation, MineValiCoder offers a robust solution to overcome LLM stochasticity. You should implement its three-module framework. This includes automatically validating test cases, iteratively refining code with monotonicity, and mutually validating code-test interactions. This approach significantly boosts code accuracy, reducing dependence on human-crafted tests and enhancing overall TDD automation.

Key insights

Automated mutual reinforcement between test-case quality and code quality is essential for reliable, fully automated TDD.

Principles

Method

MineValiCoder uses TCQM to filter LLM-generated tests, Parallel TDD for iterative, monotonic code refinement, and BiCoTeV with bipartite graph scoring and consistency-based filtering for optimal code selection.

In practice

Topics

Best for: Research Scientist, AI Scientist, Machine Learning Engineer, AI Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by cs.SE updates on arXiv.org.