Type checking, compile-time errors won't check if the program you wrote is correct, only that it's internally consistent. That is an entirely different thing than checking for correctness.
You do need a layer of tests that actually try to prove that given some input your program actually does what it's supposed to do. That is hard to automate.
Joe Armstrong(of the Erlang fame), talks about this a bit here: https://youtu.be/TTM_b7EJg5E?t=778
I've pointed to a specific timestamp, but there might be more details somewhere else in that talk.