I think you may not realize how many bugs NASA programmers are making. For instance, see the fairly simple mistake made on Deep Impact spacecraft:
https://en.wikipedia.org/wiki/Deep_Impact_(spacecraft)#Conta...
There are no doubt more, that don't cause the loss of an entire spacecraft.