I have no idea how Tesla does this, but in most cases you're deal with deterministic software or real time OS's, massive testing suites, coding guidelines that guarantee positive outcomes, etc.
JPL published its guidelines. Do you think Google and Apple are this stringent with their mobile toys? Of course not. They have zero economic interest to do so. They just have to make things good enough that kids and housewives won't complain too much.
http://spinroot.com/gerard/pdf/P10.pdf
or more specific to autos
http://en.wikipedia.org/wiki/MISRA_C
Mistakes will always happen, but Apple or Google are not good examples of what well written software is.
Which is fine, but I'm unnerved hearing the people who seem to consider Tesla infallible. 'They'll never make a mistake like that, they're Tesla!'
Errors probably means errors here. As in yeah, most recently trying to land a booster on a barge and missing.
Mistakes happen. The wrong number in a configuration somewhere and everyone's car suddenly has a vampire that sucks down the battery 50% faster, or causes a misreading of wheel speed for anti-lock braking, or etc.
Once you trust you trust, and if you don't, you don't update. Not much space between (for me) ...