

Do not unit test bugs - xvirk
https://javax0.wordpress.com/2015/02/04/do-not-unit-test-bugs/

======
dalke
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.)

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've fixed the bug, and put tests in place to keep it from happening again.

That it happens to help debugging and TDD is secondary.

Also, I believe there's a bug in this code:

    
    
        for (int n = 2; n * n &lt; number; n++) {
    

Even with the comparison the right way, there will be a silent overflow when
n*n exceeds maxint.

