4 ms·
There is a misguided notion on testing. Testing cannot establish correctness on a program unless you test every possible input and output. A test only proves a
by crimsonalucard 7y ago
There is a misguided notion on testing. Testing cannot establish correctness on a program unless you test every possible input and output. A test only proves a specific test case is correct, that's it, this is not actual program correctness.
Type checking is an actual proof that is light years ahead of a test in the fact that you need zero test cases to prove your program is correct in terms of types.
To achieve the same affect with testing you must test your function with every possible input for every possible type. An untyped addition function must test for what happens when you give that function a pointer to every possible permutation of a nested hashmap of strings and arrays otherwise you are not establishing correctness. What you are actually doing is taking a statistical sample of random inputs and guessing that the function is correct based off of that sample.
For greater predictability the test samples should be randomized following statistical procedures but this is rarely followed as most testers don't actually understand that they are taking a small statistical sample of a domain that covers an almost unlimited amount of possible inputs.
Tests are essentially selected with high programmer bias so a lot of bugs make it through.