1) The Apollo Guidance Computer software was not bug-free[0]
2) The AGC software was not written in C++
The NASA approach to software development undoubtedly results in high quality assurance, but at a huge productivity cost that most commercials shops could not shoulder.
What do you do about the huge amount of software that needs to be developed that is too complex and cannot justify things like having 5 independent concurrent executions running two completely separate but functionally identical code bases tested by a completely independent adversarial test team?
I’d argue you could start by using tools that don’t allow, let alone encourage, your programmers to make common mistakes with catastrophic consequences.
0 — see, for instance, https://ibiblio.org/apollo/Documents/COM-1.pdf