paper-with-me

Papers

How Many Code and Test Cases Are Enough? Evaluating Test Cases Generation from a Binary-Matrix Perspective

2025-10-09 · Xianzhen Luo, Jinyang Huang, Wenzhen Zheng, Qingfu Zhu, Mingzheng Xu, Yiheng Xu, Yuantao Fan, Wanxiang Che arxiv

Evaluating test cases automatically generated by Large Language Models (LLMs) is a critical yet challenging task. Existing benchmarks often evaluate the exclusion ratio on large, unstructured collections of wrong codes, suffering from high computational costs and score inflation. Furthermore, they inadvertently reward generators that detect common, trivial bugs, while failing to penalize their inability to identify rare yet critical faults. In this work, we connect two fundamental questions: (1) What is the minimal set of wrong codes sufficient to represent the entire error space? and (2) What is the minimal set of test cases needed to distinguish them? We introduce a novel framework that formalizes benchmark construction as finding an optimal diagnostic basis in a binary code-test matrix, where rows represent wrong codes and columns represent test case results. The rank of this matrix specifies the minimal number of independent error patterns (wrong codes) and provides a tight upper bound on the number of test cases required for complete fault coverage. Our objective is to identify a basis of size equal to the matrix rank that maximizes internal diversity. To tackle this NP-hard problem, we propose WrongSelect, an efficient approximation algorithm to select maximally diverse wrong codes. Applying this framework to millions of competitive programming submissions, we construct TC-Bench, a compact, diverse, and inflation-resistant benchmark. Extensive experiments show that even the most advanced test case generation methods achieve only ~60% exclusion rates on TC-Bench, exposing a significant gap in their diagnostic power and highlighting substantial room for future improvement. Our dataset is available at: https://huggingface.co/datasets/Luoberta/TC-Bench and our code is at: https://github.com/Luowaterbi/TC-Bench.

📄 PDF Abstract BibTeX arXiv:2510.08720

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

Evaluating Large Language Models for the Generation of Unit Tests with Equivalence Partitions and Boundary Values

2025-05-14 · Martín Rodríguez, Gustavo Rossi, Alejandro Fernandez

The design and implementation of unit tests is a complex task many programmers neglect. This research evaluates the potential of Large Language Models (LLMs) in automatically generating test cases, comparing them with ma…

MTGP: Combining Metamorphic Testing and Genetic Programming

2023-01-20 · Dominik Sobania, Martin Briesch, Philipp Röchner, Franz Rothlauf

Genetic programming is an evolutionary approach known for its performance in program synthesis. However, it is not yet mature enough for a practical use in real-world software development, since usually many training cas…

Program Synthesis

Null/No Information Rate (NIR): a statistical test to assess if a classification accuracy is significant for a given problem

2023-06-09 · Manuele Bicego, Antonella Mensi

In many research contexts, especially in the biomedical field, after studying and developing a classification system a natural question arises: "Is this accuracy enough high?", or better, "Can we say, with a statisticall…

Classification

HarnessLLM: Automatic Testing Harness Generation via Reinforcement Learning

2025-11-02 · Yujian Liu, Jiabao Ji, Yang Zhang, Wenbo Guo 외 arxiv

Existing LLM-based automatic test generation methods mainly produce input and expected output pairs to categorize the intended behavior of correct programs. Although straightforward, these methods have limited diversity …

Reinforcement LearningCode Generation

Evaluating Code Generation of LLMs in Advanced Computer Science Problems

2025-04-21 · Emir Catir, Robin Claesson, Rodothea Myrsini Tsoupidi

Large Language Models (LLMs), such as GitHub Copilot and ChatGPT have become popular among programming students. Students use LLMs to assist them in programming courses, including generating source code. Previous work ha…

Code Generation