LLM生成测试时依赖捷径,复杂系统表现差。
LLMs taking shortcuts in test generation: A study with SAP HANA and LevelDB
- 用编译反馈循环评估模型生成测试的推理路径。
- 在SAP HANA上测试通过率仅37%,远低于LevelDB。
- 适合关注模型真实推理能力的研究者阅读。
大型语言模型(LLMs)在公开基准上表现优异,常被宣称具备高级推理与理解能力。然而,认知科学近期研究表明,这些模型有时依赖浅层启发式和记忆,而非真正的认知能力。本文研究了LLM在软件自动化测试生成中的行为,对比开源系统LevelDB与全球最广泛部署的商业数据库系统SAP HANA——其专有代码库确保未出现在训练数据中。结合米切尔的机制导向评估方法与实证软件测试,采用突变分数和迭代编译器反馈修复循环,评估准确性和底层推理策略。结果表明,LLM在熟悉的开源基准上表现良好,但在未见过的复杂领域(如SAP HANA)表现显著下降,常优先保证可编译性而非语义有效性。该发现为当前LLMs缺乏稳健推理提供了独立的软件工程证据,并强调需建立惩罚简单捷径、鼓励真正泛化的评估框架。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have achieved impressive results on public benchmarks, often leading to claims of advanced reasoning and understanding. However, recent research in cognitive science reveals that these models sometimes rely on shallow heuristics and memorization, taking shortcuts rather than demonstrating genuine cognitive abilities. This paper investigates LLM behavior in automated test generation for software, contrasting performance on an open-source system (LevelDB) with SAP HANA, one of the most widely deployed commercial database systems worldwide, whose proprietary codebase is guaranteed to be absent from training data. We combine cognitive evaluation principles, drawing on Mitchell's mechanism-focused assessment methodology, with empirical software testing, employing mutation score and iterative compiler-feedback repair loops to assess both accuracy and underlying reasoning strategies. Results show that LLMs excel on familiar, open-source benchmarks but struggle with unseen, complex domains, often prioritizing compilability over semantic effectiveness. These findings provide independent software engineering evidence for the broader claim that current LLMs lack robust reasoning, and highlight the need for evaluation frameworks that penalize trivial shortcuts and reward true generalization.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。