Follow the money. If people were willing to commit to a specification with the same level of precision as a civil engineering blueprint and then stick to that specification then you’d see a dramatic uptick in software quality, along with a dramatic uptick in price and time to develop. But since hardly anybody wants to commit to that kind of precise design or pay the cost we get what we have today instead.
Come to SE Asia and I’ll show you plenty of civil engineering projects with similarly poor planning and execution.
There are software engineering fields where people commit to precise specifications - they typically interface with humans on some biological level (medical devices, etc), and they are quite expensive.
Of course, the same goes for military/infrastructure (self-driving trains) software.
And there are solutions for improving software safety, it starts by improving the process of software development. And for that there's at least one sort of official framework: CMMI.
(Even though DoD stopped requiring CMMI, but it still considers it a big plus, and companies for important stuff all use it.)
Of course, it'll be interesting to see what goes on with the F-35, as a lot of testing is now "skipped". (Sure, that is not software testing, but still, I can't imagine the software dev process is in a better shape after all these delays, cost overruns and probably still ongoing requirement changes.)
Come to SE Asia and I’ll show you plenty of civil engineering projects with similarly poor planning and execution.