The US National Institute of Standards and Technology (Nist) published a groundbreaking report in May 2002, The Economic Impacts of Inadequate Infrastructure for Software Testing, which estimated the cost of bugs in software to the US economy was in the order of $60 billion. In its conclusion on page 174, the authors state:
the national impact estimate from an inadequate infrastructure for software testing is $59 billion and the potential cost reduction from feasible improvements is $22 billion.
When I last checked with Nist, this research had not been updated. Today patching Windows, Cisco routers, Oracle software or whatever is a given. But even with automated patch updates, we must still test our production environments. The cost to the global economy must be astronomical.