"They Write the Right Stuff" (2007) is a Fast Company article about the methodology of the group that writes the on-board software for the space shuttle. The shuttle software has one of the lowest defect rates known of any large project, and it's all due to the process and the culture that surrounds its development. Some of the most interesting takeaways:
Specifications. People who work together on the shuttle software have to be absolutely sure that they are on the same page, that they agree about every aspect of what every part of the software will do. Before any code is written, the requirements for the on-board software are documented in excruciating detail (currently, 40,000 pages of specs for 420,000 lines of code). Compared to software in industry, the discipline needed here seems superhuman. You cannot dive in to coding until you understand precisely what needs to be done. There is no "let me build a prototype and see how it works;" no unnecessary hacks or flourishes in the code; no rock-star programmers.
Continuous improvement. Every time an error is discovered, the team doesn't just fix the error. They document the circumstances surrounding the bug and its discovery; identify how the development process allowed the bug to creep in, and amend it to prevent future occurrences; and look for latent errors that have the same source.
This process costs a lot of money, and it's not fast. But for the software that controls billions of dollars worth of equipment and (in part) determines whether astronauts live or die, it's probably worth it.