临时测试
Ephemeral Testing

原始链接: https://lemire.me/blog/2026/10/05/ephemeral-testing/

文章提出了一种“临时性测试”,这是一种一次性的集成测试形式,用于评估基础软件。开发者不再直接审查某个库或组件,而是让 AI 智能体在其之上构建临时应用、层或功能原型,然后评估这些下游项目能否成功构建出来。 简洁清晰的 API、稳定的不变量,以及有用的错误消息,应当有助于智能体快速且可靠地完成构建。隐藏状态、令人意外的默认值、不完整的文档或不稳定的行为,则往往会引发失败和补丁,从而暴露原组件的弱点。 这一过程可以使用不同的智能体和任务反复进行,在无需提前预测所有需求的情况下,模拟许多未来的使用场景。测试完成后,原型层会被丢弃。通过这种方式,临时性测试不再依靠猜测软件将如何被使用,而是通过在其之上临时构建来收集实际证据。

```text 黑客新闻 最新 | 过去 | 评论 | 提问 | 展示 | 工作 | 提交 登录 临时测试 ( lemire.me ) 11 分 由 ibobev 发布于 29 分钟前 | 隐藏 | 过去 | 收藏 | 讨论 帮助 考虑申请 YC 2027 年冬季批次! 申请截止日期为 11 月 2 日。 指南 | 常见问题 | 列表 | API | 安全 | 法律声明 | 申请加入 YC | 联系我们 搜索: ```
相关文章

原文

We have many ways to ensure software quality. Unit testing. Fuzz testing. Integration testing. And so forth.

I’d like to propose a method that was unthinkable before: ephemeral testing. (Ephemeral is a fancy word for ‘throw away’ or ‘temporary’.)

You write your code. You build your software component. Or the AI agent does it for you, it does not matter.

Then you ask an AI agent to build on it: an application, another layer, maybe several. You have it test what it built. You do not assess the original work directly. You assess how good the software built on top of it is.

It is a form of integration testing. The difference is that the software on top is entirely ephemeral. You throw it away when you are done.

A library with a clean API, stable invariants, and useful errors lets the agent produce something that works quickly. A library with hidden state, surprising defaults, or incomplete docs produces a pile of patches and failures. The failures are evidence about your code, not about the agent.

You can repeat it. Different agents, different tasks, same foundation.

In effect, instead of building the core while trying to anticipate what might be needed at the other layers, you just simulate the other layers by actually building them.

Of course, you could argue that with AI, you can rebuild everything whenever you need to. But that’s not practical. You need some form of stability.

I have been applying this trick to various projects. As I consider a new feature, I ask my AI to prototype quickly what I might later build based on what I am doing it. Ephemeral testing works for me thus far.

`; modal.addEventListener('click', function(e) { if (e.target === modal) modal.close(); }); modal.querySelector('#bibtex-copy-btn').addEventListener('click', function() { const text = modal.querySelector('#bibtex-target').textContent; navigator.clipboard.writeText(text).then(() => { const origText = this.innerText; this.innerText = "Copied!"; setTimeout(() => this.innerText = origText, 1500); }); }); document.body.appendChild(modal); const style = document.createElement('style'); style.innerHTML = `dialog::backdrop { background: rgba(0, 0, 0, 0.5); }`; document.head.appendChild(style); }                         // 1. Extract the URL             const fullLinkHtml = el.dataset.fullLink;              const tempDiv = document.createElement('div');             tempDiv.innerHTML = fullLinkHtml;              const linkElement = tempDiv.querySelector('a');             const rawUrl = linkElement ? linkElement.href : '';                           // 2. Compute the current access date             const accessedDate = this.getCurrentAccessedDate();              // 3. --- NEW LOGIC: Extract ONLY the year (YYYY) ---             // Gets the full date string, e.g., "November 23, 2025"             const fullDateString = el.dataset.year;             // Use regex to find the four-digit year at the end of the string             const match = fullDateString.match(/(\d{4})$/);             const publicationYear = match ? match[0] : '????'; // e.g., '2025'                          // 4. Generate BibTeX Data with the corrected year             const safeTitle = el.dataset.title.replace(/[^a-zA-Z0-9]/g, '').substring(0, 15);             // Use the clean year for the BibKey             const bibKey = (publicationYear + safeTitle);             const content = `@misc{${bibKey}, author = {${el.dataset.author}}, title = {{${el.dataset.title}}}, year = {${publicationYear}}, howpublished = {\\url{${rawUrl}}}, note = {Accessed: ${accessedDate}} }`;                          // 5. Show Modal             document.getElementById('bibtex-target').textContent = content;             modal.showModal();         }     }; })();
联系我们 contact @ memedata.com