Earlier quoted context omitted.
A test can test for those: "does the code give mathematically correct results?"
Even the best tests only catch like 50% of the bugs though.
Properly, if your code has an ‘if’, you need two tests, for the two branches. Same with every place the outcome may diverge. With this approach, it's basically impossible to botch the code unless something slips your mind while writing both the code and the tests. Otherwise, it's pretty much ‘deploy and go home.’