HN 提问:你们如何审查和验证 LLM 生成的代码?
3 分•作者: darkLord19•大约 1 个月前
如今,代码生成速度非常快,但如何审查和测试所有这些代码呢?
每次你让模型审查一段代码时,它都会返回不同的“发现”。因此,你仍然需要过滤掉这些发现中的噪音,才能找到实际的缺陷。
如果尝试手动进行全面审查,那么理解代码可能比从头开始编写代码花费的时间还要多。
至于测试,你可以让 LLM 编写测试,但你无法确定这些测试是否真正断言了预期的产品流程,还是仅仅为一段逻辑编写了通过/失败的测试。
我想知道你是否有任何工作流程、策略或技巧。
查看原文
It's become very fast to generate code nowadays, but how do you review and test all of it?<p>Every time you ask a model to review some piece of code, it comes back with different "findings". So, you still have to filter through the noise of their findings to get to actual defects.<p>And if you try to do the full review manually, then it might take more time to just understand the code than writing it yourself from the beginning.<p>As for testing, you can ask the LLM to write the tests, but you can't be sure if the tests actually assert the expected product flow or just write pass/fail tests for a piece of logic.<p>I would like to know if you have any workflows, strategies, or tricks.