·16小时前
较热 · 19
A green AI test suite can be a group project between the code and its mocks
RCreddit.com
查看原文一个“绿色”AI测试套件可以成为代码及其模拟对象之间的协作项目。尽管AI可以生成大部分测试套件,但至少有一个测试必须来自外部,例如捕获的API负载、旧的迁移夹具或两个请求竞争的场景。这种外部输入可以避免代码使用自己编写的答案来批改自己的作业,从而确保对AI代理编写的功能进行更独立和可靠的评估。
The agent writes the feature.
The same agent writes mocks that agree with it.
Then the tests pass.
I still let AI generate most of the suite, but one test has to come from outside that loop: a captured API payload, an old migration fixture, two requests racing, something the implementation did not invent for itself.
Otherwise the code is grading its own homework with an answer key it also wrote.
新上榜对比前 24 小时