Jack Ganssle wrote this article entitled 'Fire Code for Software'.
http://www.ganssle.com/articles/FireCode.htm
"Fire code for Software?" is essentially saying why hasn't the software industry developed an Underwriter's Laboratory or an Insurance Institute for Highway Safety for software?
Both UL and IIHS are products of the insurance companies desire to improve human safety, lower claims, and manage insurance costs. UL has been around since 1894. Software has only be around for 50 or so years and only in the last 20 or so years has software been 'mainstream'.
Currently software is not insured. Problems with software are resolved after the fact, usually by litigation.
Regulators, such as the FDA, monitor software for medical devices. The NTSB can audit software when a 'recall' event occurs involving vehicle (car, train, plane) software. Several companies have gone bankrupt because of software mistakes that killed people, Therac-25, for example.
Self-driving cars may push the issue of software testing for insurance reasons.
When the cost of software mistakes are born by someone other than the software builder and the customer, this is insurance, and the insurance companies will protect their interests.