about
Automated Test Case Generation for Vulnerabilities in Competitive Programming (arxiv.org)
1 point by PaulHoule 202 days ago | hide | past | pdf | discuss on HN

In plain words: A tool that invents tricky test inputs—stress tests, hash-collision tricks, and logic-targeted cases—to catch wrong code submissions that slip past normal tests, first checking its own tests are valid. It caught many incorrect solutions that existing test sets had wrongly accepted.

Abstract · CodeHacker: Automated Test Case Generation for Detecting Vulnerabilities in Competitive Programming Solutions

The evaluation of Large Language Models (LLMs) for code generation relies heavily on the quality and robustness of test cases. However, existing benchmarks often lack coverage for subtle corner cases, allowing incorrect solutions to pass. To bridge this gap, we propose CodeHacker, an automated agent framework dedicated to generating targeted adversarial test cases that expose latent vulnerabilities in program submissions. Mimicking the hack mechanism in competitive programming, CodeHacker employs a multi-strategy approach, including stress testing, anti-hash attacks, and logic-specific targeting to break specific code submissions. To ensure the validity and reliability of these attacks, we introduce a Calibration Phase, where the agent iteratively refines its own Validator and Checker via self-generated adversarial probes before evaluating contestant code.Experiments demonstrate that CodeHacker significantly improves the True Negative Rate (TNR) of existing datasets, effectively filtering out incorrect solutions that were previously accepted. Furthermore, generated adversarial cases prove to be superior training data, boosting the performance of RL-trained models on benchmarks like LiveCodeBench.

Jingwei Shi, Xinxiang Yin, Jing Huang, Jinman Zhao, Shengyu Tao
arXiv:2602.20213 · cs.SE, cs.AI, cs.CR · submitted Feb 23, 2026 · updated Jun 2, 2026
abstract · pdf · html

add comment on HN