Interesting Article about code and regulation, the first part about the evolution of fire regulation is quite enlightening and then there's a good transition to software
Codifying good software design
By Jack Ganssle
Embedded Systems Programming
Though computer programs aren't yet as dangerous as fire, flaws can destroy businesses, throw elections, and even kill. Car brakes are increasingly electronic and steering is headed that way. Software errors in radiotherapy devices continue to maim and take lives. Bad code has been implicated in a number of deadly aircraft incidents. The National Institute of Standards and Technology claims the cost of bugs runs some $60 billion a year in the U.S. alone.
Codes for safe software
Why are there no fire codes for software?
Today the Feds mandate standards for some firmware. But take a gander at the Federal Election Commission or Food and Drug Administration rules. The regulations are loose and woefully inadequate. Firmware is at a point in time metaphorically equivalent to the fire-fighting industry in 1860. We have sporadic but ineffective regulation. The press occasionally warms to a software crisis but by and large there's little furor over the state of the art.
Rest assured there will be a fire code for software. As more life- and mission-critical applications appear, as firmware dominates every aspect of our lives, when a bug causes some horrible disaster, the public will no longer tolerate errors and crashes. Our representatives will see the issue as good politics.