Remix.run Logo
sarchertech 4 days ago

> Also, you cannot prove something by tests; Just because you found 100000 cases where your code works does not mean there is not a case where is does not (just as you cannot prove that unicorn does not exist) :)

That’s exactly it. For any non trivial program, there exists an infinite number of ways your program can be wrong and still pass all your tests.

Unless you can literally test every possible input and every bit of state this holds true.

wubrr 4 days ago | parent | next [-]

For any 'non trivial' program there exists an infinite number of ways your program can be wrong but you still believe it's right.

Testing is not a perfect solution to catch all bugs. It's a relatively easy, efficient and reliable way to catch many common bugs though.

sarchertech 2 days ago | parent [-]

Sure but it's not a reliable replacement for understanding what the program you wrote is doing either.

pfdietz 4 days ago | parent | prev [-]

And yet, (1) testing finds bugs in any nontrivial program that hasn't been tested, and (2) test long enough and with enough variety and you can make programs significantly more reliable.

Perfect is the enemy of good, and absent academic fantasies of verified software testing is essential (even then, it's still essential, since you are unlikely to have verified every component of your system.)

sarchertech 2 days ago | parent [-]

Sure testing is useful. It's not so useful that you don't need to understand what you're doing though.