一句话:通过干预式消融实验揭示,LLM 异常测试 oracle 生成的高准确率主要依赖捷径信号而非异常文档语义。
基于 LLM 的测试 oracle 生成(TOG)在异常 oracle 预测上报告了高准确率,但其预测究竟依赖何种证据尚不清楚。本文对三个 TOG 系统(涵盖分类器式与生成式架构,参数量约 110M 至 7B)开展大规模干预式研究,在三个真实基准(两个生成测试数据集与一个新构建的开发者手写测试基准)上评估。作者首先删除 Javadoc 中的 @throws 子句,发现准确率仅小幅变化,最大降幅不足一个百分点,说明结构化异常文档并非主要驱动因素。随后采用归因引导的替换消融来识别预测所依赖的信号,发现高准确率可由捷径信号驱动:部分模型对少量结构 token 高度敏感,另一些则分散依赖大量词汇线索。这表明高异常 oracle 准确率未必反映对异常语义的稳健利用,未来 TOG 评估应不仅考察预测的 oracle 类型是否正确,还应考察预测是否有有意义的异常触发证据支撑。
LLM-based test oracle generation (TOG) methods report high accuracy on exception-oracle generation, but it remains unclear what evidence drives these predictions. In particular, do models use explicit exceptional-behavior documentation such as Javadoc @throws clauses, or do they rely on recurring patterns in tests, code, and documentation? We investigate this question through a large-scale intervention-based study of three TOG systems spanning classifier-based and generative architectures and model sizes from roughly 110M to 7B parameters, evaluated on three real-world benchmarks comprising two generated-test datasets and a new benchmark of developer-written tests. We first remove Javadoc @throws clauses and find that accuracy changes only marginally, with the largest drop below one percentage point. This indicates that structured exception documentation is not the primary driver of exception-oracle prediction. We then apply attribution-guided substitution ablations to identify the signals that predictions depend on. The results show that high accuracy can be driven by shortcut signals: some models are highly sensitive to a small number of structural tokens, while others distribute reliance across many lexical cues. These findings challenge the assumption that strong exception-oracle accuracy reflects robust use of exception semantics. Future TOG systems should therefore be evaluated not only by whether they predict the correct oracle type, but also by whether their predictions are grounded in meaningful exception-triggering evidence.