STAB: Specification-driven Testing for Algorithmic Bottlenecks
Not on the map. Why?
Abstract (arXiv)
Evaluating the efficiency of algorithmic code requires test cases that expose runtime bottlenecks. Previous methods generate efficiency test cases either by increasing input size or by generating code-specific inputs that make the given implementation run slowly. Consequently, they do not address the structural input conditions that drive the algorithmic worst case. We introduce STAB, a specification-driven pipeline that generates test cases that expose algorithmic bottlenecks from a natural-language problem specification alone. STAB separates the task into constraint-bound maximization and adversarial structure injection. (i) The constraint saturator extracts constraints and resolves large admissible size assignments using rule-based saturation and CP-SAT optimization over related variables. (ii) The adversarial scenario injector retrieves implementation-level adversarial construction principles from a curated scenario catalog using keyword matching and K-nearest neighbors (KNN). STAB encodes the problem specification, resolved boundary, and retrieved construction principles into a structured generation specification, from which the LLM synthesizes a Python test case generator. On CodeContests, STAB raises the rate of generated test cases that expose algorithmic bottlenecks from 50.43% to 73.45% on average across open-source LLMs and from 57.45% to 71.85% on average across closed-source LLMs, with consistent gains across Python, Java, and C++. Our code is available at https://github.com/suhanmen/STAB.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 21 of its 32 references that are in the map. First posted on arXiv 27 May 2026.
Builds on
21 of 32 references.
References · 21
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2022Competition-Level Code Generation with AlphaCodecited by 1,462
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
- 2024Qwen2.5-Coder Technical Reportcited by 1,203
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2021Measuring Coding Challenge Competence With APPScited by 902
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 194
- 2022ReCode: Robustness Evaluation of Code Generation Modelscited by 103
- 2024Code Generation with AlphaCodium: From Prompt Engineering to Flow Engineeringcited by 103
- 2023ChatUniTest: A Framework for LLM-Based Test Generationcited by 96
9 more
- 2024Evaluating Language Models for Efficient Code Generationcited by 73
- 2024Code-Aware Prompting: A study of Coverage Guided Test Generation in Regression Setting using LLMcited by 64
- 2024EffiLearner: Enhancing Efficiency of Generated Code via Self-Optimizationcited by 30
- 2024PerfCodeGen: Improving Performance of LLM Generated Code with Execution Feedbackcited by 24
- 2024exLong: Generating Exceptional Behavior Tests with Large Language Modelscited by 4
- 2025Synthesizing Performance Constraints for Evaluating and Improving Code Efficiencycited by 3
- 2025A Tool for Generating Exceptional Behavior Tests With Large Language Modelscited by 2
- 2025ContractEval: A Benchmark for Evaluating Contract-Satisfying Assertions in Code Generationcited by 2
- 2026CodeContests-O: Powering LLMs via Feedback-Driven Iterative Test Case Generationcited by 2
Built on by
Not cited yet.