Ask HN:你保持代码/文档/测试不腐烂的秘密武器是什么?

2作者: bochoh10 个月前
最近一直在用 Cursor 处理一些(大部分)繁琐的工作,它在两方面出乎意料地好用:保持文档的时效性,以及发现测试覆盖率的不足。例如,我会问它类似“这个函数最有可能以什么方式出错?”的问题,它会给出我没想到的边缘情况。 尽管如此,它并非(可能)是万能的,有时会“幻觉”出一些无用的测试用例,所以仍然需要一些批判性思维。 我很想知道大家都在用什么来保持文档/测试的可维护性?你们是依赖 AI,还是用老方法?
查看原文
I&#x27;ve been using cursor lately to handle some (most) of the grunt work and it&#x27;s been surprisingly useful for two things: keeping documentation from going stale and spotting gaps in test coverage. For example, I&#x27;ll ask it things like &quot;what&#x27;s the most likely way this function could break?&quot; and it will suggest edge cases I hadn&#x27;t thought of.<p>That said, it&#x27;s not (maybe?) magic and sometimes hallucinates test cases that are rubbish so some critical thinking is still required.<p>I&#x27;m curious what y&#x27;all are using to keep docs&#x2F;tests maintainable? Are you leaning on AI or doing it the old fashioned way?