Testing is not perfect, but what else is there? Even formal proofs are just another expression of testing. With greater mathematical guarantees than other expressions, granted, but still testing all the same; prone to all the very same human problems testing is burdened with.
The difference with proofs (whether formal or informal) is that they quantify over all possible cases, whereas testing is always limited to specific cases.