问HN:你有什么秘密武器来防止代码/文档/测试的腐烂?
最近我一直在使用 cursor 来处理一些(大部分)繁琐的工作,发现它在两个方面特别有用:保持文档的新鲜度和发现测试覆盖的空白。例如,我会问它“这个函数最可能出现什么样的错误?”它会建议一些我之前没有想到的边缘情况。
不过,值得一提的是,它并不是(可能)魔法,有时会产生一些毫无意义的测试案例,因此仍然需要一些批判性思维。
我很好奇大家都在用什么方法来保持文档和测试的可维护性?你们是依赖人工智能,还是采用传统的方法?
查看原文
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?