I worked for 5 yrs in a CMMI-5 rated software development environment. 100% bug-free code was the mandate. No exceptions.
When I left that job, we believed all critical errors were fixed. The project continued for 15 more years. Part of the software validation was root cause analysis for any bugs found at any point of the development process. There were 7 levels of testing to the system, 5 of those levels happened by outside companies who reported to a different govt directorate. Their independence was critical.
Over those 15 remaining years, over 100 critical bugs were found in the software which existed at the time we believed it to be bug free. It is hard to explain to non-developers, but every line of code that I touched has my name attached. There is no hiding. As a development team of 15 people, we were causing less than 1 bug every other year in the code. Extremely high quality software that wasn’t trivial.
A critical bug was something that could cause catastrophic vehicle loss and total loss of crew. Each vehicle was estimated to be worth over $2B. Bugs were found during missions, but none ever prevented the mission from being completed or broke the vehicle(s). There were other catastrophic vehicle failures, unfortunately. These were world news for months.
So … I can say with some authority that angry.sardine is correct. The program “Tex” is commonly used as the example of nearly bug free code in the world. Don Knuth wrote it and paid bug bounties for any errors found. Errors were so rare that people didn’t usually cash the cheque, preferring to post it on their walls instead.