requestbaby · 验收指南requestbaby · Guide

怎么验收 AI 写的代码?How do you accept AI-written code?

AI 一次写出几千行代码,已经没人读得完。逐行审查成了形式,真正要回答的是:它做的事,是不是我要的事?下面是一套不依赖读代码的验收方法:写下你自己的验收标准,真的跑一遍,用证据决定收不收。AI can produce thousands of lines at once and nobody reads them all. Line-by-line review becomes a formality, and the real question is whether what it built is what you wanted. Here is a way to accept work without reading every line: write your own acceptance criteria, run them for real, and decide on evidence.

为什么只看 diff 不够Why reading the diff is not enough

独立验收的四条原则Four principles of independent acceptance

  1. 独立于实现。Independent of the implementation.从接口边界和界面外部去验,不依赖被测代码的内部结构,也不由写代码的那一方来定标准。 Check from the API boundary and the UI outside. Do not rely on the code’s internals, and do not let the author set the bar.
  2. 标准由你定。You own the criteria.期望值来自需求,而不是来自 AI 生成的代码。你说“订单创建后状态是 pending”,用例就这样写。 Expected values come from the requirement, not from generated code. If a new order should be pending, the case says so.
  3. 要有证据。Keep evidence.请求与响应记录、界面每一步的截图,比一句“我检查过了”可靠,也能转发给别人看。 Recorded requests and responses and a screenshot of every UI step beat “I checked it”, and can be forwarded to others.
  4. 可重复,并对应版本。Repeatable and tied to a version.同样的用例每次得到同样的结论,并且知道它验的是哪一次提交。 The same case gives the same verdict every time, and you know which commit it verified.

接口验收清单API acceptance checklist

界面验收清单UI acceptance checklist

用 requestbaby 落地Putting it into practice with requestbaby

requestbaby 把上面的原则做成了工具:用例是 JSON 文件,运行时不调用大模型,结论由你写下的断言决定。最短的一条路径:requestbaby turns these principles into a tool: cases are JSON files, no model is called when running, and the verdict comes from the assertions you wrote. The shortest path:

requestbaby init myapi && cd myapi
requestbaby vars set baseUrl http://localhost:8080 -e dev
requestbaby new case collections/orders 创建订单 -m post
requestbaby send collections/orders/01-创建订单.json --suggest   # 看真实响应,按字段写断言
requestbaby run                                                  # 跑全部用例
requestbaby verify -e dev --report html                          # 校验 + 全部用例 + 全部流程,生成报告requestbaby init myapi && cd myapi
requestbaby vars set baseUrl http://localhost:8080 -e dev
requestbaby new case collections/orders create-order -m post
requestbaby send collections/orders/01-create-order.json --suggest   # see the real response, assert per field
requestbaby run                                                  # run every case
requestbaby verify -e dev --report html                          # validate + all cases + all flows, write a report

让 AI 帮你写用例时,先让它读 When you want AI to write cases, have it read requestbaby guide(一页写法速查),写完用 (a one-page cheat sheet) first and check the result with requestbaby validate 检查。. The exit code of requestbaby verify 的退出码 0 表示全部通过、1 表示有用例失败、2 表示无法完成验证,可以直接放进 CI。 is 0 when everything passed, 1 when a case failed and 2 when verification could not complete, so it fits straight into CI.

下载 requestbabyDownload requestbaby

几个常见的坑Common pitfalls

下一步Next steps

免费下载,几分钟内跑出第一份带截图的验收报告。想先看看它的样子,回到Download it free and get your first screenshot-backed acceptance report within minutes. To see what it looks like, go back to the 首页home page;遇到问题见; for help see the 支持页support page。.

下载 requestbabyDownload requestbaby