For more info on this search for "defensive programming", "Immunity-aware programming" and "preventitive programming". Several hardware companies have manuals/rules for programming in harsh environments.
Even if you're not into hardware it's worth a look, lots of cool tips.