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