跳转至

GPT-6 Astra 测试与验证技术的有效性评估

Test and Verification Technique Effectiveness with GPT-6 Astra

文章背景与核心概要

随着大语言模型 (Large Language Model, LLM) 编程能力的持续演进,AI 智能体 (AI Agent) 是否应该自行编写软件测试一直备受行业争议,社区中甚至一度盛传“AI 写测试只会添乱、毫无用处”的论调。本项实测研究基于最新一代大模型 GPT-6 Astra,在 Zstd RFC 压缩规范、IMAP 协议实现以及耗费约 9 万美元 Token 成本的超大规模 Pandoc 复杂工程任务中,重新系统评测了测试驱动开发 (Test-Driven Development, TDD)、模糊测试 (Fuzzing)、基于属性的测试 (Property-Based Testing, PBT) 及形式化定理证明工具的真实效能。评测不仅见证了 GPT-6 Astra 相较于上一代 GPT-5.6 Sol 在基准测试 (Benchmark) 正确率和单次推理成本上的飞跃,更有力揭示了结构化验证方法在复杂任务中的不可替代性,对片面盲目的“反测试论”进行了极具说服力的实证反思。


概要

Summary

基于此前对代码智能体 (Coding Agent) 如何应用测试与验证技术的一系列评估,本项研究换用全新的 GPT-6 Astra 重新进行了深度测试。评测覆盖了多个代表性基准测试,包括 Zstd 算法实现、IMAP RFC 协议开发,以及一个按官方零售标价折算耗资约 9 万美元 Token 的超大规模 Pandoc 评测任务。

Building on previous evaluations of how coding agents employ test and verification techniques, this evaluation re-runs tests using GPT-6 Astra across benchmarks like the Zstd implementation, the IMAP RFC, and a larger Pandoc eval costing ~$90k in MSRP tokens.

核心结论包括: * 能力全面跃升:相比于上一代 GPT-5.6 Sol,GPT-6 Astra 展现出了惊人的能力突破,在较简单的基准测试(如 Zstd)上表现甚至达到了完全饱和的状态。 * 特定技术行之有效:在 Sol 时代,相比不做特定限制的“默认” (Default) 基准方案,几乎所有特定的测试方法反而都会拉低智能体表现;而 Astra 却截然不同,它能够成功驾驭结构化模糊测试、差分测试 (Differential Testing)、基于属性的测试库(如 Proptest)以及 ACL2 等形式化验证工具。 * 事实需要推敲,切勿盲信网络热梗:网络上那些断言“经验证明 AI 自己写的单元测试毫无用处”的病毒式爆款言论,严重简化了测试数据,并且完全无法推广到复杂真实任务场景中。这提醒我们,在评估和使用智能体时,必须依托严谨翔实的实证数据,而不是盲从以偏概全的流行结论。

Key takeaways include: * Capability Gains: GPT-6 Astra shows massive improvements over GPT-5.6 Sol, mastering simpler benchmarks (like Zstd) to the point of saturation. * Effective Techniques: Unlike Sol—where almost all specific testing methods degraded performance compared to a baseline "Default" approach—Astra successfully utilizes structured fuzzing, differential testing, property-based testing libraries (like Proptest), and formal tools like ACL2. * Nuance Over Virality: Viral claims asserting that "AI-written unit tests are empirically proven to be unhelpful" oversimplify the data and fail to generalize across problem complexity, highlighting the need for rigorous, evidence-based agent utilization rather than broad generalizations.


1. 引言:从 GPT-5.6 Sol 到 GPT-6 Astra

1. Introduction: From GPT-5.6 Sol to GPT-6 Astra

今年 8 月,我们使用 GPT-5.6 Sol 评测了 智能体在运用测试与验证技术时的实际表现。当时,如果要求 Sol 采用测试驱动开发、QuickCheck 甚至 Lean 4 这类专业方法,它生成的代码往往只是对这些技术的拙劣模仿。而如果不指定任何测试方法——即采用所谓的“默认”模式——模型虽然会随手写出一堆价值不大的单元测试,但讽刺的是,它的整体表现却反而超过了绝大多数指定测试方法的场景。究其原因,要求当时的智能体按既定规则进行测试,往往只会让它发挥得更差。当时的评测任务基于 Zstd RFC 压缩规范展开。

In August, we evaluated how well agents used test and verification techniques using GPT-5.6 Sol. When asked to employ methods like TDD, QuickCheck, or Lean 4, Sol generally produced a caricature of these techniques. Not specifying a test method—referred to as Default—resulted in many worthless unit tests, which ironically outperformed most specific techniques because asking agents to test in prescribed ways mostly made them worse. That evaluation utilized the Zstd RFC.

如今使用 GPT-6 Astra 重新运行完全相同的评测,我们观察到了两个关键性转变: 1. Astra 的底层基础能力获得了大幅跃升,在 Zstd 实现评测中直接达到了“满分饱和”(在开启中等推理算力时,几乎所有测试条件下的正确率都达到了 100%)。 2. 智能体运用各种软件测试与验证技术的能力得到了显著提升,变得切实有效。

Re-running the same evaluation with GPT-6 Astra reveals two major differences: 1. Astra's base capability has increased significantly, saturating the Zstd implementation evaluation (almost every condition achieves 100% correctness on medium effort). 2. Agents appear to use test and verification techniques much more effectively.

性能与成本对比

Performance and Cost Comparisons

  • Zstd RFC 任务:在 GPT-5.6 Sol 时代,智能体在中等算力消耗下需要花费 3.50 美元,获得 63% 的全测试通过正确率;在超高算力 (xhigh) 下花费 5.50 美元,正确率提升至 77%。而在 Astra 上,智能体在中等算力下仅需花费 1 美元,就能在超过 99% 的运行 中达成完全正确的测试结果。
  • 模糊测试表现:旧版 Sol 生成的测试输入杂乱无章、毫无实际意义,反复命中的也是同一条代码路径;而 Astra 在被要求进行模糊测试时,能够自主构建具有良好结构的测试输入,主动覆盖不同代码路径以挖掘隐藏的深层 Bug(不过由于 Zstd 任务已被 Astra 的超强能力完全打满饱和,这一优势在此基准测试中未能被完全量化测量)。
  • Zstd RFC: With 5.6 Sol, agents spent $3.50 on medium effort and \(5.50 on xhigh effort to hit full test correctness 63% and 77% of the time, respectively. With Astra, agents achieve full test correctness over **99% of the time** at medium effort for just **\)1**.
  • Fuzzing Behavior: Sol generated random, worthless inputs that hit the same code paths. Astra, when asked to fuzz, structures inputs to exercise code paths and uncover non-trivial bugs (though this couldn't be fully measured due to Zstd benchmark saturation).

2. 拓展至更高难度挑战:IMAP 与 Pandoc

2. Expanding to Harder Tasks: IMAP and Pandoc

鉴于 Zstd 评测已被 Astra 彻底打穿饱和,我们引入了难度更高的全新挑战:在针对每种测试条件进行 80 次独立运行的情况下,测试 IMAP RFC 网络协议的实现。

Because Zstd was saturated, we tested a harder challenge: the IMAP RFC across 80 runs per condition.

在这一测试中,默认方案再次展现出强劲实力,尽管某些特定的测试条件在消耗更多计算资源的代价下取得了更高的正确率。为了进一步探索那些智能体无法通过“一击即中” (One-shot) 轻松搞定的超高难度复杂任务,我们采用了 此前用于比较不同编程语言效率的 Pandoc 基准测试。

Once again, Default performed strongly, though some conditions yielded higher correctness at the cost of higher resource usage. To push further into tasks that agents cannot easily one-shot, we evaluated the Pandoc benchmark previously used to compare programming languages.

因为 Pandoc 的复杂程度极高,在智能体平均经历约 14 轮对话交互后,没有一种测试配置能够实现 100% 的完美通过率。因此,我们转而统计测试用例的通过比例,而不是追求完美通关的运行次数比例。受限于高昂的评测成本,每种条件各运行了 25 次,整个测试过程消耗的 Token 按官方零售标价折算约为 9 万美元。

Because Pandoc is significantly harder, no condition reached 100% correctness after roughly 14 turns on average. Consequently, we analyzed the fraction of tests passed rather than the fraction of perfect runs. Due to cost constraints, each condition was run 25 times, totaling approximately $90k in MSRP token spend.

Pandoc 评测结果的核心观察

Observations on Pandoc Results

  • 与旧版 Sol 中非默认技术全线崩盘溃败的景象完全不同,Astra 在数种特定测试条件下均取得了超越“默认”基线方案的优异成绩。
  • 尽管由于样本限制导致的理论误差范围较大,但击败默认方案的技术数量之多,足以证明某些系统性的验证策略确实能够切实提升模型的任务表现。
  • 强制使用规范基于属性的测试 (PBT) 框架的库终于生成了真正有价值的测试样例,这与学界长久以来的理论预期完全吻合。
  • 测试驱动开发 (TDD) 表现再次垫底走弱,但与以往测试不同的是,其他同样会生成大量微型测试用例的配置方式并没有出现性能下降。这一实测事实有力地动摇了“写很多细碎测试本身必定有害”的粗糙论断。
  • Unlike Sol—where non-Default techniques underperformed across the board—Astra showed several conditions outperforming the Default baseline.
  • While the conceptual error bars are wide, the sheer number of techniques beating Default makes it plausible that certain verification strategies genuinely improve performance.
  • Property-based testing (PBT) libraries that force proper PBT usage finally generated meaningful tests, aligning with expected theoretical benefits.
  • TDD once again underperformed, but unlike previous tests, other conditions that generated many small tests did not underperform. This weakens the simple narrative that writing many small tests is inherently detrimental.

3. 面向未来研究的开放性课题

3. Open Questions for Future Research

由于受限于成本,Pandoc 评测中每种条件的样本量仅为 25 次运行,这给后续研究留下了若干值得深入探讨的开放性问题: 1. 外推有效性 (Extrapolation):如果我们将交互轮数进一步放宽以追求接近完全通过,这些技术的优劣排名是否依然稳固成立? 2. 路径依赖性 (Path Dependence):当智能体在多轮迭代中不断修补生成代码时,高度的路径依赖究竟引入了多大幅度的方差波动? 3. 提示词敏感性 (Prompt Sensitivity):提示词中细枝末节的微小变动(如句式结构改变、大小写差异等)究竟会在多大程度上颠覆最终评测结果? 4. 问题代表性 (Problem Representation):仅凭这单个“Pandoc 级别”的大型任务,能在多大程度上代表包含 100 个同等难度任务的广阔软件工程集合?

Because our sample size for the Pandoc eval was limited to 25 runs per condition, several open questions remain: 1. Extrapolation: Do these rank orders hold up if we run additional turns to approach near-complete correctness? 2. Path Dependence: How much variance is driven by the high degree of path dependence when looping over generated code? 3. Prompt Sensitivity: How heavily do minute, trivial changes (sentence structure, capitalization) alter the results? 4. Problem Representation: How representative is this single "Pandoc-sized" problem compared to a broad suite of 100 similar tasks?

想要严谨地回答上述问题,必须大幅扩大评测规模——这显然已经超出了独立研究者的个人承受极限,但对于学术界的研究生团队或资金充裕的顶尖 AI 实验室来说,完全具备可行性。

Answering these rigorously would require scaling up evaluations significantly—beyond what is practical for an individual researcher, though potentially feasible for academic grad students or well-funded AI labs.


4. 关键成果与核心启示

4. Notable Highlights and Takeaways

尽管我们在大范围的普遍推广性上保持审慎态度,但以下几项具体的实测发现仍然格外引人注目:

While noting the low confidence in broad generalization, a few specific results stand out:

  1. 差分测试 (Differential Testing):迫使智能体细致入微地审视边界条件,并编写出能够精准检验边界两侧行为的健壮测试用例。
  2. 测试驱动开发 (TDD) 表现欠佳:这一结果符合先前的预期,不过其他同样会大量生成测试用例的方法在本次评测中依然斩获了不俗的战绩。
  3. ACL2 表现亮眼:定理证明器 ACL2 表现十分优异,延续了其在 GPT-5.6 Sol 评测 Zstd 时的强劲势头。虽然 Lean 4 凭借庞大的学术界支持最终可能会超越它,但在当下,ACL2 依然是极其可靠的工程利器。
  4. 基于属性的测试 (PBT):Proptest 表现非常出色,这表明随着基础模型能力和泛化能力的不断提升,模型对高质量测试的理解与运用正在自然生发,甚至无需额外进行专门的微调 (Fine-tuning)。
  1. Differential Testing: Forced agents to closely examine boundary conditions and write tests that accurately implemented both sides of a boundary.
  2. TDD Underperformed: Aligns with prior expectations, though other high-test generation conditions performed well.
  3. ACL2 Performance: The theorem prover ACL2 performed well, matching its success in the 5.6 Sol Zstd eval. While Lean 4 may eventually surpass it due to heavy academic backing, ACL2 remains a viable tool today.
  4. Property-Based Testing (PBT): Proptest performed well, suggesting that as base model capabilities and generalization improve, models get better at testing organically without specialized fine-tuning.

5. 对网络爆款“反测试论”的实证反驳

5. Critique of Viral "Anti-Testing" Claims

在完成这些测试与公开发布本文之间,网络上曾流传着一条引发广泛转发的爆款论调:

Between running these tests and publishing this post, a viral claim circulated arguing that:

💬 [原文引用 / Original Quote]: “……实证表明,AI 编写的单元测试和集成测试毫无用处。你应当告诉你的智能体,彻底停止自己写测试的行为。”
...AI-written unit tests and integration tests are empirically proven to be unhelpful. you should tell your agents to stop writing tests by themselves

这一论断源自于利用 Sonnet 5.5 High 在一些任务难度极低的 DeepSWE 基准测试上得出的结论。然而,从多个维度来看,这一说法都存在着致命的逻辑与实证漏洞:

This claim—derived from DeepSWE benchmarks using Sonnet 5.5 High on much simpler tasks—is flawed for several reasons:

  • 任务难度错配:在简单的入门任务中失效的工程技巧,绝不意味着在应对复杂宏大的真实世界软件工程问题时同样会失效。
  • 成本与正确率失衡:所谓“舍弃测试带来的节省”,仅仅只是缩减了微不足道的 9% 成本;这种片面追求省钱的做法,彻底无视了在大型真实评测中通过测试换来的巨大正确率提升和深层次行为检验价值。
  • 评分系统本身的缺陷:DeepSWE 的评判机制存在缺陷——如果智能体自行编写的测试函数名恰好与评测系统内部隐藏的评判测试重名冲突,系统就会判罚扣分,从而人为制造了“写测试反而受罚”的假象。
  • Task Difficulty Mismatch: Techniques that fail on simple tasks do not necessarily fail on complex, real-world problems.
  • Cost vs. Correctness: The "savings" amounted to a minor 9% cost reduction by dropping tests, ignoring massive differences in correctness and deep behavioral verification seen in larger evals.
  • Grader Flaws: DeepSWE's grading mechanism penalizes added tests if an agent's custom test name conflicts with a hidden grader test, creating an artificial penalty for writing tests.

夸大其词、语气斩钉截铁的片面观点往往最容易在社交网络上疯传,但在真实的智能体工程实践中,它们是最糟糕的指南。诸如 Nolan Lawson 针对 JavaScript 前端框架的 AI 开发成本 所作的研究等实证证据清晰地证明:唯有依托实测数据做决策,才远胜于凭直觉和网络炒作 (Vibes) 人云亦云。

Overstated, highly confident claims go viral easily, but they remain poor guides for practical agent utilization. Empirical evidence—such as Nolan Lawson's work on the AI cost of JavaScript frameworks—demonstrates the value of making evidence-based decisions rather than relying on vibes.


附录

Appendices

附录 A:为什么顶级 AI 实验室很少公开发布技术对比研究?

Appendix A: Why Don't AI Labs Publish More Technique Comparisons?

顶尖 AI 实验室虽然坐拥海量资源,完全有能力对各种提示词策略与验证技术展开全方位评测,但他们却极少将详尽的研究结果公之于众。一方面,业务营收的迅猛增长迫使他们将工程重心放在其他商业优先级更高的工作上;另一方面,不同机构之间的模型底层架构差异显著(例如 OpenAI 与 Anthropic),导致最佳提示词策略截然不同。此外,由于在复杂的多轮对话任务中,提示词哪怕产生最细微的变动都可能导致成功率剧烈起伏,因此总结并发布放之四海而皆准的普适性指导建议不仅成本极其高昂,在工程实现和方法论上也极为困难。

While AI labs possess the resources to run comprehensive evaluations on prompt techniques and verification strategies, they rarely publish detailed findings. Rapid revenue growth prioritizes other engineering efforts, and differing model architectures (OpenAI vs. Anthropic) mean optimal prompting strategies vary wildly. Furthermore, because prompt variations can dramatically alter success rates on complex, multi-turn tasks, publishing generalized prompt advice is both expensive and logistically difficult.

附录 B:来自智能体测试社区的讨论与见解

Appendix B: Agentic Testing Community Comments

  • David R. MacIver 指出,与 Claude 相比,ChatGPT 除非收到明确指示,否则通常不太愿意主动编写基于属性的测试,这反映出不同模型之间在提示词敏感度或特定技能储备上的潜在差异。
  • Roman Leventov 分享了一则实战案例:在利用模糊测试和智能体代码审查重构一个包含 3 万行代码的 TypeScript 状态图系统时,智能体审查员成功抓出了约 210 个 Bug;然而,为了仅仅找出 20 个深层未知缺陷(约占 Bug 总数的 10%),模型生成的测试脚手架代码竟膨胀到了令人咋舌的 30 万行,从整体投资回报率 (ROI) 来看,在该特定工作流中这项测试策略显然是得不偿失的。
  • David R. MacIver noted that ChatGPT is typically less proactive about writing property-based tests compared to Claude unless explicitly prompted, indicating potential model-specific prompting sensitivities or skill-sharing discrepancies.
  • Roman Leventov shared a case study on rewriting a 30k-line TypeScript statechart system using fuzzing and agent reviewers. While agent reviewers successfully flagged ~210 bugs, generated test harnesses required an enormous support footprint (300k lines of testing code) to find just 20 de novo defects (roughly 10% of total bugs), categorizing it as an overall negative ROI result for that specific workflow.

感谢 Laurence Tratt、Edward Z. Yang、Sophia Wisdom 以及 Marco Primi 对本文提出的宝贵意见、勘误与深入探讨。

Thanks to Laurence Tratt, Edward Z. Yang, Sophia Wisdom, and Marco Primi for comments, corrections, and discussion.