TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Do not unit test bugs

1 点作者 xvirk超过 10 年前

1 comment

dalke超过 10 年前
I disagree. This is a regression test for a bug reported from a customer. (In the text, a tester noticed the bug, though the developer said it was a from a customer.)<p>This sort of thing is also part of customer relations. It will lead to bad PR if the same bug pops up again. You want to be able to tell your customer that you&#x27;ve fixed the bug, and put tests in place to keep it from happening again.<p>That it happens to help debugging and TDD is secondary.<p>Also, I believe there&#x27;s a bug in this code:<p><pre><code> for (int n = 2; n * n &amp;lt; number; n++) { </code></pre> Even with the comparison the right way, there will be a silent overflow when n*n exceeds maxint.