Even with access to source code proving software correctness is almost impossible. It certainly isn't cheap in terms of man hours or money.
History has shown that software bugs will exist in almost all non-trivial code regardless of how much testing is implemented.
History's Worst Software Bugs
I'm surprised the Airbus A320 crash at the French airshow didn't make the list but there are plenty of air and space examples in there.
Edit: Fixed the link