r/programming • • Apr 07 '16

The process employed to program the software that launched space shuttles into orbit is "perfect as human beings have achieved."

http://www.fastcompany.com/28121/they-write-right-stuff
1.4k Upvotes

423 comments sorted by

615

u/slavik262 Apr 07 '16

I don't like the dichotomy the article seems to create - that most software is written by egoistic, "up-all-night, pizza-and-roller-hockey software coders", and systems software is written by stuffy "grown-ups". Embedded/systems critical software is generally more robust because:

  1. Its usefulness is predicated on it being (almost/hopefully) bug-free, moreso than desktop, server, or web applications.

  2. More time and money is put into testing and review to ensure the previous point.

Then again, maybe I'm just lacking perspective - I was in kindergarten when this article was written. To the older folks here: has the landscape changed that much in 20 years?

308

u/goodstuff37 Apr 07 '16

I'm probably ten years older than you. I started out writing device drivers for mobile phones, and there was definitely a different mentality. The penalty for a mistake when you're shipping a physical product is huge compared to a web application that can be updated within days, if not hours. The incentive for quality changes depending on the business environment. So in a way, nothing has really changed.

There have probably always been problems requiring higher quality, as well as problems which tolerate lower quality but ship fast and fail fast, and engineers who are drawn to the former and the latter.

310

u/scarytall Apr 07 '16

This. What the NASA engineers did was great. But people who get all uptight about this, in either direction, seem to imply that software development is one-size-fits-all. They built software to that level of robustness because they needed to. Others build software with less robustness because they don't need to. It's not better engineering write code to solve a problem you don't have. It's like thinking a 2-door coupe that can tow 10 tons is engineered any better than a heavy-duty pickup that cannot.

8

u/Bobshayd Apr 07 '16

I would think that a heavy-duty pickup that cannot tow as much as a 2-door coupe would not be a well-designed vehicle.

6

u/pohatu Apr 07 '16

Unless your goal is to survive ieds. Then your heavy armor plating sucks the towing capacity away, and maybe you even tweaked the transmission for fast acceleration versus torque. So you tow less then a miata but you can get in and grab people and get out.

I'm taking the analogy too far.

→ More replies (5)
→ More replies (5)

3

u/Mason-B Apr 07 '16

A reason I like to use this article though is when companies act like the problem was going to happen regardless (think sony and it's network failures). Well maybe it was going to happen regardless because you don't care enough to make sure it doesn't.

3

u/way2lazy2care Apr 07 '16

"Boeing's product testing is second to none resulting in industry best failure rates. This is why we've decided to adopt a similar system for quality assurance on every Big Mac we serve!"

→ More replies (2)

2

u/JessieArr Apr 07 '16

We can just fix it in production!

"Now deploying hotfix to Low-Earth rendezvous orbit in T minus 5... 4..."

1

u/DrMonkeyLove Apr 07 '16

Exactly. You should always write software to meet your requirements. If the customer doesn't have a requirement that your software not crash every once in a while, then don't spend millions of dollars making sure it doesn't crash once in a while. You absolutely should not write web apps the same way your write aerospace software.

→ More replies (1)

1

u/[deleted] Apr 07 '16

This is correct. If you had a billion dollars to write a Web app (with no commercial pressures) then you would spend that to make sure it was as perfect as possible when it launched.

1

u/ours Apr 08 '16

less robustness because they don't need to

I'll add some lines of business simply can't afford to be all that robust. It takes time and personnel to put the necessary processes and run them. Lots of business would benefit from more robust software but most couldn't afford it (either in time and/or money).

→ More replies (102)

2

u/parisjackson2 Apr 07 '16

I totally agree - I was with my wife when she got a 3D sonogram. The machine was by GE and it was just a beautiful piece of tech. My first thought was how much effort must have been spent on QC. Lots of tech just has little to no room for error.

1

u/megablast Apr 08 '16

The penalty for a mistake when you're shipping a physical product is huge compared to a web application that can be updated within days, if not hours.

What you are talking about is more managements attitude than devs attitude. We want to do it right, but don't have the time.

1

u/[deleted] Apr 08 '16

The difference is that your driver is expected to do one thing well in a stable environment. A "web app" has to handle everything from IE 6 onwards, safari something stupid, Firefox, Chrome, a bunch of mobile browsers on a dozen possible platforms. You literally have thousands of possible combination that you need to check. Of course things will break all the time.

If web apps had one consistent system to target they would be a dream to program. That's why the iPhone was such a good target for the 2-6th year after it came out.

→ More replies (1)

44

u/RenaKunisaki Apr 07 '16 edited Apr 07 '16

It all depends on what you're making software for.

A video game that can easily be patched? Just hurry up and get it looking finished. If there are any major bugs we can put out a patch.

A commercial office suite? You want to test pretty well before shipping, but if something goes wrong it's not the end of the world.

Guidance control for a rocket? You damn well better get it right the first time, even if it takes a long time and huge budget.

Also, rocket guidance systems usually are running on purpose-built, military-grade, radiation-hardened machines that only run the guidance system, and are directly used by a few dozen people. It's a very different situation from an app that's expected to run on hundreds of thousands of peoples' home computers, which are in hundreds of different languages and which are also running essentially infinite variations of OSes and patches, hardware, other apps, configurations, use cases, viruses, and users.

People often ask "why do today's word processors require so much more memory/storage/CPU/updates than the one on my C64?" and the answer is they do so much more. The one on your C64 probably didn't...

  • support every human language in common use, including ones like Chinese, Korean, and Arabic that have very different methods of drawing and arranging letters than English (including several of these in the same document!)

  • support embedded images, comments, links, notes, revision history, macros, fonts, charts, and videos

  • support more than one font in a document, especially fonts that weren't built in

  • run on a wide variety of different machines and OSes

  • have to deal with other apps in the background

  • have to handle any conceivable arrangement of monitors, resolutions, and colour depths

  • support spell check (with ability to edit the dictionary), rich WYSIWYG formatting, various page layouts, and print previews

  • have more than a few levels of undo/redo

  • support collaborative editing, both offline (merging your version with someone else's) and live (multiple people editing the same document at the same time)

  • allow editing in the middle of the document without a bunch of disk juggling

  • import and export a bunch of other programs' file formats

  • perform translations and text to/from speech

  • have a crash recovery function (that could also save your ass after eg a power failure)

  • some didn't even support more than a few pages in one document

The same applies to design. Speciality software like rocket guidance control can be made much more reliable than the apps you run on your PC because it only has to do one job in one situation, and has the entire machine not just dedicated to but built for it.

(edit: added a couple more items)

5

u/userx9 Apr 08 '16

I do software verification for an aerospace company. I don't really understand the point of the article. Nearly every piece of software that flies is written more or less the way described in the article. There's no need to write all software like that though.

14

u/Someguy2020 Apr 07 '16

A video game that can easily be patched? Just hurry up and get it looking finished. If there are any major bugs we can put out a patch.

Ask WB how that worked out for the PC version of Arkham Knight.

I don't disagree with you, just pointing out you have to maintain some sort of quality bar.

2

u/nyando Apr 08 '16

Fair point, but there are LOTS of games that come out and still need patching. XCOM 2 ran like absolute ass on release and had tons of visual bugs, still sold like hot cakes. The game runs a lot more smoothly since the last couple patches, but those took a solid month to come out. As long as there's nothing that really breaks the game or impacts gameplay significantly, there seems to be a willingness to excuse bugs in game software.

→ More replies (1)

4

u/NewAnimal Apr 07 '16

You just reminded me of the days when undo didn't go back infinitely

→ More replies (1)

4

u/pinealservo Apr 07 '16

Also, rocket guidance systems usually are running on purpose-built, military-grade, radiation-hardened machines that only run the guidance system, and are directly used by a few dozen people.

This is largely true, but it's also interesting to note that many aerospace guidance programs run on radiation-hardened versions of really old standard CPU architectures. I'm sure part of this is because you just can't radiation-harden recent super-miniaturized semiconductor processes, but also because hardware designs as complex as CPUs have bugs too, and the old simple 8-bit CPU architectures have been thoroughly explored and their bugs well-documented.

This probably varies a lot from project to project, but I wouldn't be surprised to find a fairly new satellite with essentially the same brain as a C64.

4

u/Alborak Apr 08 '16

Eh, the processors that are available don't lag that far behind, generally 4-6 years or so. What get's used is probably another 5 years or so older than that. For example, Curiosity has a RAD750 processor, made in 2001. It's changing a bit now since Power is dead/dying, but you can actually get 32 bit rad-hard ARM or SPARC processors for fairly cheap theses days.

Also, it does vary wildly from project to project. Most military stuff doesn't have to be rad-hard, and you need some beefy processing when you're going mach 3 while 5 meters above the water. Generally rad hardened isn't needed unless you're going beyond LEO.

→ More replies (1)
→ More replies (10)

27

u/[deleted] Apr 07 '16

To the older folks here: has the landscape changed that much in 20 years?

Extreme Programming and the Agile Manifesto and Scrum and all that was coming out around the time this article was written.

In my experience the received wisdom at the time (as reflected in this article) was that all software should be written this way, which is utter foolishness. Most software, most companies, can handle a much higher failure rate if it's balanced by faster time to delivery. The dot-com explosion of the late 90s / early 00s proved this.

Personal story - my shop (semiconductor fab) had a very rigorous waterfall process. I'd been asked to do a project. To make a point, I followed the process to the letter. I wrote that req document and sent it out for signatures and refused to write a line of code until it came back. Because that was the process. After giving a status update 3 weeks in a row of "Waiting on the req document" our director got really mad at me, but wouldn't you know it, the process changed shortly thereafter.

Alistair Cockburn developed a set of "Crystal methodologies" which scaled along several axes. E.g., if you have a really small team on a really short project and nothing significant happens if the code fails, you can afford a much "lighter" engineering process than if you have 250 people on a multi-year project and people will die if the code fails.

Analogously, you wouldn't design and build a doghouse with the same care you would design a home.

Our profession does need to "grow up" in many ways, and in some of the ways this article touches on (e.g., estimation, some disciplined practices), but that doesn't mean we need a heavy software process for any and all projects.

2

u/debausch Apr 07 '16

I realized that I'm prone to 'overengineering' in my own projects. I usually start with an idea, get some fast prototype results, but I always think about either stuff that could break my program or things that need to be included before releasing.

After getting frustrated I won't touch it for at least some days...

2

u/BornOnFeb2nd Apr 08 '16

"Minimum Viable Product" is your friend.

51

u/K3wp Apr 07 '16

Then again, maybe I'm just lacking perspective - I was in kindergarten when this article was written. To the older folks here: has the landscape changed that much in 20 years?

Bell Labs veteran here.

The "systems" guys that wrote the software that powers the modern world were, for the most part, stuffy "grown-ups". Middle-aged 'greybeard' computer scientists.

The only exception I can think of is Linus Torvalds, who bucked the trend and caused much consternation among the "Olde Guard" of system guys. Something many people are surprised to know is that while the Bell Labs Unix guys hated Windows/Apple products, they hated Linux even more. As they felt it was both a sloppy effort and derivative.

But Linus should really only get partial credit, as he was both heavily influenced by Andy Tannenbaum and dependant on the Gnu project (Richard Stallman, etal) for the user-land stuff.

I will also admit that I am extremely fatigued with the prevalent mythology that the Internet was invented/pioneered by drop-outs and children. All the core protocols and RFCs were developed long ago by stuffy "grown-ups", not pizza-and-roller-hockey software coders. Silicon Valley wouldn't exist without the foundation built by the systems programmers.

6

u/[deleted] Apr 08 '16

stuffy

I only knew one guy from Bell Labs, and "stuffy" is the last word I'd use to describe him. Although he was Australian, so there's that.

I still remember when I asked him a question about C++ and he fired off an email to Stroustrop to find out the answer.

9

u/K3wp Apr 08 '16

I only knew one guy from Bell Labs, and "stuffy" is the last word I'd use to describe him. Although he was Australian, so there's that.

Andrew Hume I would think. Yeah he was a cool dude but he mostly worked on user-land stuff like development tools.

I still remember when I asked him a question about C++ and he fired off an email to Stroustrop to find out the answer.

You can email Bjarne yourself and he'll probably answer if you are polite and the answer isn't in his faq.

5

u/[deleted] Apr 08 '16

Yep, that's him. I'd forgotten his last name. We worked together on a project at AT&T around 20 years ago. I was straight out of college and he was really kind, patient, and respectful to me. He bought me a stuffed gecko and I have it to this day, sitting on top of my monitor.

3

u/K3wp Apr 08 '16

If you were at or around Murray Hill in 95'-96' we may have actually encountered each other. I was a sysadmin there at the time, working in the InfoLab primarily.

It was really amazing how cool and approachable all the CS guys were, especially compared to all the douchey assholes I encounter these days.

→ More replies (3)

19

u/jeandem Apr 07 '16

Even the most Ivory Tower computer scientists have nothing on the elitism expressed by former Bell Labs people.

8

u/K3wp Apr 07 '16

They really aren't any different. The computer scientists that didn't retire (like Dennis Ritchie) either migrated to the Google or Higher-Ed Ivory tower.

They are also pretty cool for the most part. Bjarne Stroustrup is super chill. So is Brian Kernighan.

Shockley was a huge asshole, but I'm almost certain he suffered from some sort of undiagnosed mental illness.

Edit: Btw, it was my experience @Bell Labs that led me to be a "egoistic, up-all-night, pizza-and-roller-hockey software coder" vs. a systems programmer.

5

u/hackaroni Apr 08 '16

Shockley, one of the transistor/diode guys? Who helped get us off of tubes? christ, he can be as big an asshole as he wants.

→ More replies (12)

2

u/mcguire Apr 08 '16

Torvalds is more of an "old guard" type than many would think. Finnish jerk that he is, he spends a lot of his time fending off weird experimental things and general sloppiness.

Also, the Bell Labs guys, in my experience, hate the Gnu project, too. (Witness the go language still built on the Plan 9 tool chain (which I understand just recently grew optimization).) I believe they also hate the BSDs (and other 'real Unixes') for vi, character addressable terminals, and sockets. Stuffy grown-ups can be flaky, too.

But yeah, if you really want something to work, get a balding guy in slacks to look at it.

1

u/mreiland Apr 08 '16

But yeah, if you really want something to work, get a balding guy in slacks to look at it.

lmao. It's a funny mental image.

1

u/K3wp Apr 08 '16

Torvalds is more of an "old guard" type than many would think. Finnish jerk that he is, he spends a lot of his time fending off weird experimental things and general sloppiness.

Torvalds is a little older than me and I think he really is the "Gen-X" bridge between the "old guard" boomer greybeards and the dipshit nerf-gun/razor-scooter Millennials.

Also, the Bell Labs guys, in my experience, hate the Gnu project, too.

Oh, absolutely. I remember one of them quipped that "Gnu isn't free, as you have to buy into Stallman's political ideology". Gnu also put my dad's organization, the software technology center, effectively out of business as nobody was willing to pay expensive licenses when they could get free clones from Gnu. My dad even asked Stallman once if he could him a break and rip-off Microsoft for a year or two instead of AT&T.

I believe they also hate the BSDs (and other 'real Unixes') for vi, character addressable terminals, and sockets.

BSD is a by-product of Ken's sabbatical to UCB in the 1980's. But you are correct, Rob Pike has critiqued all those things.

4

u/pinealservo Apr 08 '16

I've read many accounts of the early development of Unix and C, which are basically (together or apart) mixed thoroughly into the foundation of most computer systems today, and they don't strike me as stuffy "grown-ups" in the way they did the early development.

Reading the book "Coders at Work" really highlighted the fact that a lot of the people who invented foundational parts of today's computing infrastructure were basically bright kids that happened to be in the right place at the right time to apply their brains to interesting problems in environments that published their works widely. A lot of them were "up-all-night" hackers, though certainly not all of them.

I think it takes a mix of stuffy "grown-ups" and young "up-all-night" hackers to get the right combination of innovation, excitement, and real-world grounding and experience that lead to lasting software systems. Places like Bell Labs, MIT and Xerox PARC in their heydays seem to have had a magical brew of opportunity, vision, enthusiasm, and few-strings-attached funding that are really hard to replicate today.

6

u/K3wp Apr 08 '16 edited Apr 08 '16

I've read many accounts of the early development of Unix and C, which are basically (together or apart) mixed thoroughly into the foundation of most computer systems today, and they don't strike me as stuffy "grown-ups" in the way they did the early development.

I'll one-up you by letting you know my father worked on Unix/C during the early days (primarily as a project manager) so I literally grew up in that environment.

I remember hearing a story about how a young Bill Joy visited Bell Labs and showed Dennis and Ken his fledging editor, vi. They weren't overtly hostile to it, but they certainly weren't interested in participating in any efforts to make Unix "user friendly" or more accessible to non-systems programmers.

If you have ever seen Mythbusters, Ken Thompson is pretty much like Jamie Hyneman. A real no-nonsense and serious engineer.

A lot of them were "up-all-night" hackers, though certainly not all of them.

Most of the Bell Labs people didn't like that term (hackers/hacking) and Ken particularly took the podium to warn people of the dangers of glorifying shoddy engineering and petty criminality.

I think it takes a mix of stuffy "grown-ups" and young "up-all-night" hackers to get the right combination of innovation, excitement, and real-world grounding and experience that lead to lasting software systems.

Yet somehow all the stuff people actually was made by "stuffy" grown-ups. Ethernet, TCP/IP, HTML, C++, WiFi, etc. were all the products of a lifetime of very serious industrial R&D by professional computer scientists.

4

u/pinealservo Apr 08 '16

I think we may simply have a different idea of what a "stuffy" grown-up is. I can totally buy Ken Thompson being like Jamie Hyneman, but "stuffy" grown-up is nowhere near the first thing that comes to mind when I think of either of them. Sure, they have strong opinions on how to do things, but they're both largely self-taught and just ended up doing the stuff they love to do; they're both more highly proficient and technically-informed craftsmen than "stuffy engineers".

You really ought to read Peter Seibel's interview with Ken Thompson in "Coders at Work"; he describes how he was into electronics as a hobby in high school, building theremins and radios and stuff, so he went to Berkeley for an EE degree. He sort of coasted through classes there; started playing with an analog computer, taught himself to program assembly language on a digital computer by getting a program dump and reading through it over a vacation, volunteered to help other EE students fix their computer programs. Made friends with professors that worked with computers; one of them signed him up for grad school after his senior year and he was having so much fun he just kept going, although he didn't really consider himself to be taking classes. They created little "research" classes for him to teach, and he got a Masters degree out of it.

Another professor set the Bell Labs recruiters on him; he initially skipped the meetings or slept through them, but the recruiter eventually invited himself over to Ken's house and invited him to interview. Ken refused, saying he didn't want a job! The recruiter said, "Hey, it's a free trip, and you can do what you want there!" He finally agreed; he spent two days at Bell Labs and the rest of the trip driving up and down the coast visiting friends. But when he was interviewing, he saw that the people there were the ones he'd been reading the papers of while leading his little research classes, and they seemed to be doing fun stuff, so he signed on; didn't seem like work to him!

His first job there was to work on MULTICS; when AT&T pulled out, he kept on doing operating system stuff on the big machine they'd leased for the MULTICS work even though he wasn't supposed to. He expected he'd eventually be fired for it. When that machine was gone, he scrounged together some little PDP-7 machines other departments weren't currently using and did the initial UNIX filesystem work there, along with a graphical computer game! Later, he and Dennis basically made the excuse of developing a "document processing system" so they could get a PDP-11, which was big enough to fit a compiler on and really get UNIX off the ground. And once it was up and running with real users, they pulled plenty of late nights implementing features they thought were cool when others weren't doing document processing!

So basically, they'd hijacked resources under questionable pretenses to work on stuff they explicitly weren't supposed to be working on, but which they thought was great fun. If this is stuffy grown-up behavior to you, then you must have lived a pretty blessed and unrestrained life! Of course, that was a lot of years ago, and Ken grew up and presumably learned a bit more discipline, but now he's at Google where apparently he's paid to play around and invent new programming languages for fun.

As for all the other stuff; I don't think you really have a good idea of how Ethernet, TCP/IP, etc. came to be. I'm sort of a computer history geek, so I spend a lot of time watching and reading interviews of the people involved. And I know intimately well how stuff like IEEE standards and the WiFi Alliance work; the last ~10 years of my career have been working on new parts of the 802.1 LAN/WAN bridging standards for time-sensitive networking; my coworkers have edited standards and chaired committees and all that good stuff. I mostly work on details of getting the conceptual work integrated into actual test equipment and into products, but I participate in the standards meetings sometimes when we host them. There are definitely some stuffy professional engineers involved, but also some really colorful characters and some largely political players. Certainly a lot of effort by people who are technically adults has gone into these things, but the actual individuals tend to be highly non-uniform in background and personality! Important stuff happens when smart people who are passionate about something get to work on it long enough and people with political clout recognize the value in the work. That's all "serious industrial R&D" is.

→ More replies (5)

0

u/[deleted] Apr 08 '16

[deleted]

2

u/K3wp Apr 08 '16

Well, me personally, I was there so this was all first-hand stuff.

Not too much in the media. Here is Dennis hating on the haters (and MIT/windows/macs/pcs/vidya etc.)

https://nerd.h8u.net/2011/10/13/unix-haters-handbook-anti-foreword-by-dennis-ritchie/

Ken Thompson hating on Linux:

http://genius.cat-v.org/ken-thompson/interviews/unix-and-beyond

Doug McIlroy saying Linux is a fat fuck:

https://en.wikipedia.org/wiki/Unix_philosophy#Doug_McIlroy_on_Unix_programming

10

u/youlleatitandlikeit Apr 07 '16

I think the landscape has and hasn't changed. I think that frameworks and methodologies are way more common now in mainstream amateur programming than they were 20 years ago.

260 is a lot of people. Also, they probably had extremely rigorous limitations on requirements.

4

u/gerryn Apr 07 '16

The fact that they had a set hardware platform should be a blessing though, they would only have to account for a single version of the hardware - or have the benefit of working with the hardware/driver coders if there were any changes needed. I'm just guessing but that is a good way to try to ensure as stable as possible software platform.

3

u/worldDev Apr 07 '16

There's the other fact that the hardware being used is complex and functioning in extreme environments meaning failsafes need to exist for hardware malfunction and false sensor readings.

10

u/[deleted] Apr 07 '16

I've been in and around software development for over 20 years professionally, and as an amateur a good 10 years before that. The landscape HAS changed, but only to open up new ways of doing things, because new technology allows new methods.

Back in the 80s and early 90s, you couldn't really do agile iterative work because you had no method to do continuous improvement. Once you shipped software, that was it. No patching, no updates, no new features. So everything was effectively waterfall heading for that one delivery checkpoint. Sure you could iterate during your dev periods but once you "went gold" that was it. Whether you were doing embedded systems, games or whatever, once it was signed off you were done.

Once you had a method to deliver updates and patches then there was a reason to accelerate release - lower your costs and increase your risk as you could mitigate it in a patch. And once you started having software delivered as a service, well, the client doesn't even control the software so you just update it for them.

The old ways are still valid for some use cases. I wouldn't want the space shuttle or my bank's financial reconciliation software to have bugs that got ironed out in v2. However most new use cases do not require this due diligence and extremely front-heavy development. What the article doesn't spell out is that the shuttle program is an exceptionally inefficient way to write and release code. It is ridiculously expensive and slow. $35m per year for 30 years ($1B) for a few hundred thousand lines of code? It is done this way because it HAS to: the software protects many lives, national PR failures and billions of dollars of hardware. Therefore its method is the correct one.

New methods are better at solving newer problems, and doing it in a competitive and cost-effective way. If you have no constraints over expenditure and release cadence (or at least no commercially realistic ones) then you can afford to do things this way. Almost everything used to be done this way, and changed to new methods when they became available, as they didn't have the same risk profile.

11

u/kyrsjo Apr 07 '16

Another funny thing is how the article talks about the "two databases" which they claimed were the key to their success. Then they basically describe version control and an issue tracker. Things which today are standard and cheap/easy-to-use.

2

u/[deleted] Apr 08 '16

Though, how they used it is pretty fascinating, writing forecasting software to predict future errors.

2

u/immibis Apr 08 '16

Back in the 80s and early 90s, you couldn't really do agile iterative work because you had no method to do continuous improvement. Once you shipped software, that was it.

Sure you could. Do some work, show it to the product owner, have them tell you what to do next, repeat. (I don't know if they used the term "product owner" back then)

You just couldn't get feedback from your entire user base.

→ More replies (1)

1

u/pinealservo Apr 08 '16

Agile methods were basically developed by groups that were either internal to some large organization writing business software for them or external contractors mostly captive to government or some business.

I'm not disagreeing with you: shrink-wrap software and embedded systems were certainly done the way you describe during that period, and with good reason, but that wasn't the only software being written, and I'm pretty sure the seeds of what was to become Agile had already sprouted then.

19

u/lykwydchykyn Apr 07 '16

It's a shame that the article seems to focus on the software developers in that sense, since the actual content is an indictment less against developers and more against managers and stakeholders. If someone is asking me the question, "Why are there bugs in the software? Why isn't it perfect?", I can point to this article and say "Here's what it takes to get perfect code. Are you willing to do this?"

Because the problem isn't my T-shirts or pizza or whatever non-white-collar accoutrements you want to name, the problem is that the stake holder changed scope 6 times on a whim, can't describe the requirements beyond the vaguest terms, and wants it delivered by next week for the original price.

3

u/Rainfly_X Apr 08 '16

I work in a domain where the stakeholders don't usually know exactly what they want, and it's our job to figure out the details. This makes the most sense because:

  • We're working with old software. The limitations are often unintuitive. We can accomplish almost literally anything, but it may take a long time or end up buggy if it's contrary to the underlying reality.

  • When stakeholders get too specific or inflexible, we end up boxed into a bad spec, for the above reason.

  • Often even we don't know the ideal path, and it's worth one or two exploratory efforts before one of them feels both doable and maintainable.

For our application, there are very few scenarios where a detailed spec doesn't tie us to a burning building, no matter who writes it! The best thing to give us is a description what you want, as high level and unvarnished as you can, and we can work out the rest collaboratively.

Unfortunately, the current org structure has an intermediate step that is overspecifying projects badly. These aren't bad people, but the process is wrong, and it's expensive (in time and effort) to synchronize with this external division that otherwise drops projects in our lap with contradictory or needlessly painful requirements.

2

u/lykwydchykyn Apr 08 '16

I guess I hadn't considered that side of detailed specs. Especially nowadays when we depend on so much software written by other people, it is kind of good to have some wiggle room.

Good point.

Those last-minute scope changes, though...

→ More replies (1)

6

u/[deleted] Apr 07 '16

Apparently people that work on the software used in airplane cockpits write 2 lines of actual production code A WEEK, the rest of the time being used to write FORMAL proofs of correctness. As you would prove a mathematical theorem.

8

u/kt24601 Apr 07 '16

Think of that next time you hear someone say, "self-driving cars will be in production in three years."

Once the problem is completely solved, making it production-worthy is not easy.

5

u/RagingAnemone Apr 08 '16

Technically, those aren't formal proofs of correctness, but formal proofs of accuracy to the specification. It doesn't deal with inadequacies in the spec, or undefined behavior. And, of course, it doesn't prove the absence of unexpected behavior.

1

u/[deleted] Apr 08 '16

Yes, you're correct. Bad phrasing on my part

→ More replies (1)

1

u/Alborak Apr 08 '16

Eh, that number is a little low, even given the terrible quality people working on those systems. It's more along the lines of 100 LOC a week, with that being split 40:60 production:tests.

Formal methods are catching on, but you still pretty much have to test every line. If you follow MCDC, that means you have to pretty much test every branch in the code.

0

u/[deleted] Apr 08 '16

[deleted]

→ More replies (1)

1

u/floider Apr 08 '16

The source of that number is over the life of the projects so, for say a 24 month project it is more like:

Months 1-3: requirements definitions/interface documentation (preliminary design) Months 4-6: architecture design, tracing requirements to functional units, etc. (critical design) Months 7-12: actual coding Months 13-18: software integration/testing Months 19-24: system integration/testing

The lines will start to get blurred, but the reason you seem to get so little production per week is mostly due to the fact that on a 2 year project you only spend 6 months coding.

4

u/NighthawkFoo Apr 07 '16

It depends on the environment. You have to remember, 20 years ago the typical application was either a 16-bit Win 3.1 or 32-bit Win 95 application. The Internet was still a novelty, and most applications ran stand-alone, with perhaps some minor networking functionality.

There were exceptions, of course, like enterprise mainframe software, but that cost almost as much as the shuttle code did, since it had the same amount of process.

2

u/crackez Apr 07 '16

This was originally written in the 90s, keep that in mind. The article itself is dated.

2

u/ObjectiveCopley Apr 07 '16

up-all-night, pizza-and-roller-hockey software coders

...roller hockey?

2

u/slavik262 Apr 07 '16

I was just quoting the article. 90s stuff, man.

5

u/ObjectiveCopley Apr 07 '16

The funny thing is... I'm a software developer... and I'm a retired roller hockey player. But i've just never heard that as a stereotypical programmer... lol

→ More replies (1)

0

u/[deleted] Apr 07 '16

[deleted]

3

u/slavik262 Apr 07 '16

The article was written in 1996.

0

u/[deleted] Apr 07 '16

[deleted]

→ More replies (1)

1

u/GoTheFuckToBed Apr 07 '16

you have to give the people what they want to hear

1

u/nickiter Apr 07 '16

Tolerance for error is fairly high in my line of work (identity and access management), because of the ease of fixing bugs as they're found.

1

u/[deleted] Apr 08 '16

Embedded/systems critical software is generally more robust because:

Except when it comes to security.

1

u/stackered Apr 08 '16

this reply is exactly on point, even the question at the end. I was only 6 when this was written but definitely the landscape has changed... entire frameworks were built by "grown ups" for web/app/commercial software development and have ushered in an era where having systems software and web software knowledge can have a strong crossover. I'm more of systems / data guy myself but I think every type of programming these days incorporates methodologies and frameworks to help reduce bugs that we've learned from cases like the one in the article

1

u/trustfundbaby Apr 08 '16

lol ... why do you think waterfall was a thing? because back then you couldnt just do a sprint and fix the bug on "software" that had gone out on CDs to lots of people.

1

u/gperlman Apr 08 '16

I've heard that to get "nearly bug-free" came at a cost of $25,000 per line of code.

1

u/creepy_doll Apr 08 '16

Ultimately, NASA process is perfect for NASA quality. But it's an extremely slow and rigorous process where the essential deliverables are final quality.

Any software where lives do not depend on it generally has speed and cost of delivery as important counter-balances to the quality.

I do think that there are a lot of places(nearly everywhere) that are too fast and loose, but there's no need to go all the way to nasa standards or they simply could not be competitive in the private market. No-one will install your bullet-proof app if your competitor can add somewhat buggy features in 1/10th the time.

The process needs to match the product.

1

u/snarfy Apr 08 '16

This one time, I forgot to increment the build number when burning the master CD image for our software product, which wasn't found until after a million CDs had been pressed. They were all scrapped.

The mentality was it was like sending the software off to the moon. Once it was burned on to the CD, it had to work 100% bug free since there was no guarantee of updates or online connectivity.

Today, nobody cares. All apps are under-construction betas, might even brick your phone.

1

u/[deleted] Apr 09 '16

Yeah, it's like who fucking cares that the software you're running has thousands of bugs, you probably won't run in to them and if you do the worst that can happen is thpically you need to restart the program.

People are talking about TTD as if it were important to find these bugs. But honestly, for most programs the bugs worth finding are the bugs you'll find anyway.

Critical software on the other hand, yeah it shouldn't have bugs.

→ More replies (45)

37

u/dark_g Apr 07 '16

Writing flight software for NASA was one of my first jobs, a little over 20 years ago. We did indulge in frowned-upon but all-too-common sins, as in writing code first and then going back to "adjust" design documents. If there was a secret to our success it lay in extensive, thorough TESTING and attendant fixes. And underlying that, a simple fundamental fact: we had TIME. Lots of time. The launch was years away. Go check any mission: the software, the operating systems, the real-time executives go at least 10 years back, maybe 15. Practically everybody on Earth was running something more modern and up-to-date than our onboard computers!

9

u/RagingAnemone Apr 08 '16

I find this funny. Why is it assumed changes to the design documents first are the "grown up" method, while adjusting to code first is the "childish" method.

5

u/damienjoh Apr 08 '16

Largely "measure twice, cut once" philosophy appropriated from other engineering disciplines.

1

u/floider Apr 08 '16

ind this funny. Why is it assumed changes to the design documents first are the "grown up" method, while adjusting to code first is the "childish" method

There are several reasons:

  1. The biggest is simply thoroughness. You have to make the change to the code, but it easy to forget to or procrastinate on updating the documentation. I am sure everyone has done this at some time or another. If you change the documentation first you will never forget to make the code change.

  2. The assumption is that if you change the design documents first you have to think through the change and see what else it might effect. This can prevent unintended induced errors from changes.

  3. It helps highlight deficiencies in documentation. Why was there a problem in the first place? Was there a missing or unstated requirement? An error in the software architecture or intent? Or was it an actual coding error? The answer to that question may be important to figuring out what the appropriate fix is, so answering it first helps.

1

u/RagingAnemone Apr 08 '16

I've responded to most of this in another post, but I'm just wondering how much it all depends on the situation. I mean, if a true business requirement has changed, I can see going to the docs first. But I work in a situation that detailed technical functional spec isn't really useful. The clients won't understand it, and the business people within my organization won't read it. It would be created as a cover my ass move at most, but that is just for the blame game.

So if anything it would only be used internally. Now there are definitely situation where it would be useful. But well organized code will do 90% of it and I'm not sure the remaining 10% is worth the cost of maintaining the functional spec.

→ More replies (1)

1

u/mindyercircuits Apr 08 '16

Because one implies that you thought through the ramifications of a change before making it, and the other, by definition, means that the first thing you did was change it.

One is the action of an experienced adult. The other is the action of a child.

2

u/RagingAnemone Apr 08 '16

No it doesn't. I agree that thinking through the ramifications before making the change is a good thing, but looking through the code vs looking through the documentation doesn't have an advantage either way. The code has the advantage of the one true way since it's what actually runs and if you commented your code correctly, then you'll have better context in the small. The design docs will give you better context in the large which may be incredibly relevant with huge change to the business process. So what I'd go to first would depend on the situation, but the majority of changes I'd likely change the code first. The only situation where I can see you'd always change the docs first is in a architect/code monkey situation where you need a detailed technical functional spec.

→ More replies (1)

85

u/[deleted] Apr 07 '16

Bill Pate, who's worked on the space flight software over the last 22 years, [/url]says the group understands the stakes: "If the software isn't perfect, some of the people we go to meetings with might die.

Oh the irony, an unmatched url tag in the middle of a quote on the consequences of bad code. I laughed too hard.

48

u/MoTTs_ Apr 07 '16

I have to admit, I'm a little underwhelmed by the process. Maybe the article lost a lot of the good technical details, but as it reads now, it doesn't sound impressive.

#3, the "databases beneath the software," sounds like source control and a bug tracker.

#2, "the verifiers," is a QA team.

#4, "fix whatever permitted the mistake in the first place," sounds like a postmortem.

And finally #1, "the spec," is moderately interesting, but not necessarily in a good way. Any new feature requires a spec to be written, probably a very voluminous spec, that borders on pseudo-code, and coders are to implement exactly that pseudo-code. That makes it sound like the real programming happens when the spec is drafted, and the coders are just monkey see, monkey do. In reality, that may not be the case, but that's what I pictured based on the article's description.

65

u/gramie Apr 07 '16

To be fair, source control and bug tracking were much less common when this article was written, 20 years ago.

19

u/MoTTs_ Apr 07 '16

Oh, heh. I didn't see the date at first. Makes me wonder now what NASA's modern software practices are like.

13

u/awesomemanftw Apr 08 '16

Move fast and break things of course

5

u/theepicgamer06 Apr 07 '16

Don't they keep a lot of projects open source.

29

u/lykwydchykyn Apr 07 '16

as it reads now, it doesn't sound impressive.

That's probably a good thing, it means in the last 20 years some of these lessons have sunk in and become standard practice. I work with some old-school programmers who still haven't come around to version control or bug trackers.

0

u/[deleted] Apr 07 '16

[deleted]

17

u/lykwydchykyn Apr 07 '16

So... umm... totally unrelated to your comment in any way, is there some product or service you would advise me to avoid for no particular reason if I value my personal safety?

7

u/Michaelmrose Apr 07 '16

From his posting history "I'm 27/M/German and an engineer in the automobile industry for a bit over a year."

He said he wanted to move to china and taiwan but perhaps he didn't sooo BMW?

3

u/Conpen Apr 08 '16

He could very well be with VW, Audi, Porshe, or Mercedes. (Granted, some of those do own others).

→ More replies (1)

0

u/[deleted] Apr 07 '16

[deleted]

13

u/[deleted] Apr 07 '16

Hoping it's not a car but it's a car isn't it?

2

u/TamaHobbit Apr 07 '16

Christ mate, why can't you git?

→ More replies (2)

1

u/OneStrayBullet Apr 08 '16 edited Apr 08 '16

My team's mobile development process is tighter and better organized than that, which is a pretty scary though.

7

u/cahphoenix Apr 07 '16

It's not impressive. It's just a rigorous process...a set of rigorous processes. There is no way to test software to this degree without spending a crapload of money and time to do so. It's basically built around a slow evolutionary spiral model where builds may come out every couple months. These builds are then retested and tested for new features, while requirements updates are made when needed.

1

u/frequentthrowaway Apr 26 '16

The difference is that they do what they know they should, rather than just saying so.

39

u/dominic_failure Apr 07 '16

Give me a well defined, static set of requirements, and the same resources (people and money), and I too can put out some damned fine code. Sadly, I don't get any of those; requirements change daily, and I have a bunch of underpaid college graduates with no practical experience. So, yeah, of course the code is going to be a steaming pile.

10

u/droogans Apr 07 '16

This is how I feel.

The only thing I think could apply nicely to this that's closer to my world would be finance and banking. Don't change the laws and spend the better part of a decade detailing literally every single tiny regulation as pseudo-code, and then we can get started on making 3-month adjustments twice a year for the next century or two.

Hopefully nobody comes up with something better, or it'll be several billion dollars wasted. Who knows.

7

u/BornOnFeb2nd Apr 08 '16

Your requirements change daily?

Man, how can you tolerate that stagnation? I've had requirements change directions multiple times in a day (stupid meetings with various stakeholders)

1

u/global_decoherence Apr 08 '16

I joined my first job recently and i found this extremely frustrating. And everyone around me was as if nothing happened. I never thought this would be such a frequent occurrence.

1

u/BornOnFeb2nd Apr 08 '16

Yup. It's a side-effect of what is no doubt a hybrid version of Agile/Waterfall you're doing...

in Waterfall, requirements being refined is an excellent thing. Changing words on a document is simple.

In agile, the stories are created, and last the sprint....

In the Sisyphean hell that is a "hybrid" approach (or AgileFall), you get your requirements, are expected to code them up, and while you're coding, they change the requirements.

Just wait until you have this scenario...

Boss: Global, we need the application change in X manner.

 Okay!  No problem.!

[Weeks pass]

Boss: Global, why was the application changed in X manner?

ProTip- Don't take requirements verbally. If you're GIVEN verbal requirements, write them up in an e-mail, and send it to them confirming you "captured everything". Save the e-mails. :)

1

u/[deleted] Apr 08 '16

I remember distinctly one day i got three emails within 15 minutes of details changing. I responded saying I was done for the day and that I would come back the next day if they had made up their mind

1

u/[deleted] Apr 08 '16

I'd much rather deal with the stress of risking the lives of my colleagues and billions of dollars worth of equipment than deal with the headache of supporting multiple devices and operating systems that independently update at irregular intervals, an undetermined number of users with varying levels of technical savvy, and undetermined load that can suddenly change at the whim of the hive mind. When you only have to support one piece of hardware and your userbase is a handful of people with PHD's with intimate knowledge of the inner workings of the machine and the universe, it's much easier to make shit that doesn't break especially when the specs are written by people smarter than yourself.

1

u/[deleted] Apr 08 '16

I sometimes think that at some places 'agile programming' is management speak for "you don't need no stinking requirements. Just code."

12

u/totemcatcher Apr 07 '16

So:

  1. Develop Requirements, know your capabilities, plan, proofs.

  2. Code, peer review, test units, integration tests.

  3. Version control and blame chain.

  4. Develop Methodology, iterate under new methods.

It's like anything, except with enough time and money to actually get it done. :)

11

u/readams Apr 07 '16

Richard Feyman's appendix to the Rogers Commission report on the Challenger disaster is very much worth reading: http://science.ksc.nasa.gov/shuttle/missions/51-l/docs/rogers-commission/Appendix-F.txt

18

u/slavik262 Apr 07 '16 edited Apr 07 '16

To quote the relevant bit,

To summarize then, the computer software checking system and attitude is of the highest quality. There appears to be no process of gradually fooling oneself while degrading standards so characteristic of the Solid Rocket Booster or Space Shuttle Main Engine safety systems. To be sure, there have been recent suggestions by management to curtail such elaborate and expensive tests as being unnecessary at this late date in Shuttle history. This must be resisted for it does not appreciate the mutual subtle influences, and sources of error generated by even small changes of one part of a program on another. There are perpetual requests for changes as new payloads and new demands and modifications are suggested by the users. Changes are expensive because they require extensive testing. The proper way to save money is to curtail the number of requested changes, not the quality of testing for each.

But go read the whole thing. Feynman is incredibly perceptive and somehow manages to make a lecture on engineering ethics captivating.

7

u/orn Apr 08 '16

That was one of Feynman's greatest gifts; he could make anything captivating. His child-like enthusiasm and exceptional insight was absolutely intoxicating.

8

u/julianh2o Apr 07 '16

This is a very interesting read, but I think the speculation that in the future all software will be written to a similar standard is wrong.

In the majority of the cases, bug-free software doesn't pay. Obviously when you're talking about astronaut lives and expensive rockets, it does. But if you're writing the next social network, working the last few bugs out isn't cost-effective and is unlikely to ever be.

1

u/glaivezooka Apr 07 '16

but it should be for operating systems and tools

145

u/whackri Apr 07 '16 edited Jun 07 '24

zephyr grandiose expansion touch close price enter fertile rhythm degree

This post was mass deleted and anonymized with Redact

87

u/notathr0waway1 Apr 07 '16

Haven't there been several instances where the microcode shipped with Intel CPUs had a bug and had to be updated?

96

u/ibisum Apr 07 '16

Indeed the OP is misguided. There have been tons of bugs in the Intel microcode over the years, fixed with a patch. This is one of the points of the microcode in the first place.

8

u/deadeight Apr 07 '16

Even when measured as a percentage of code written? I'd imagine Intel have produced a lot more.

10

u/ibisum Apr 07 '16

I'm not saying that chip makers don't have rigorous and outstanding quality control, because they do, but they also allow for engineering bug fixes to be posted after the product ships and have acceptable fix schedules in their planning. With life-in-danger systems, all aspects of the system are certified anyway: chips, software, power. It can be very difficult to patch a running SIL4 system and still keep the rating... Even cpu manufacturers have to recert.

10

u/neonKow Apr 07 '16

The point probably stands. Most physical objects have to be shipped error free; any fix is very expensive. So people tend to make them work well.

Electrical, mechanical, and civil engineering often deal with projects that cannot be patched, so those get extra safeguards. There are other projects that can be easily patched or replaced, and people don't go through the same rigor.

The same sentiment applies to software. However, most software can be patched, so people are rightfully taking advantage of the flexibility to introduce a lot of features you can't in hardware. This doesn't make error-free code "better" than code with errors if the error-free code takes 10 times as long to release.

3

u/pinealservo Apr 08 '16

On the other hand, let me introduce you to a cool little store called "Harbor Freight". :)

Even in the world of physical goods, there are plenty of areas where consumers decide that it's sometimes okay to release fundamentally flawed physical tools if they're cheap and easy and usually do what you want, at least once or twice before breaking. And sometimes they improve over time as the most egregious problems are fixed, too.

→ More replies (3)

2

u/flying-sheep Apr 07 '16

Sure. Now that system updaters and reboots can autopatch them, Intel doesn't have to be as rigorous anymore

2

u/crusoe Apr 07 '16

Silicon too. Worked around with microcode. Intel erratas are huge.

1

u/whackri Apr 07 '16 edited Jun 07 '24

society pocket slap relieved door angle provide dolls versed truck

This post was mass deleted and anonymized with Redact

0

u/[deleted] Apr 07 '16

[deleted]

19

u/NighthawkFoo Apr 07 '16

It's been both. There was a critical bug in the virtualization instructions recently, and Intel responded by just disabling them completely via microcode.

0

u/[deleted] Apr 07 '16

[deleted]

15

u/INTERNET_RETARDATION Apr 07 '16

Disclaimer: I'm not an expert at this

Not necessarily, modern x86 CPUs are basically x86 emulators running on a proprietary microarchitecture, that's what the microcode is for. The instruction's microcode backing could be erroneous, meaning it could be fixed with a patch. But it could also be broken in the microarchitecture meaning it can't be fixed via patches.

44

u/randomguy186 Apr 07 '16

Exactly. Good, fast, or cheap: NASA picked "good" twice.

3

u/chcampb Apr 08 '16

Literally nothing on earth goes faster than what NASA puts into orbit.

They picked good and fast fast, not "completed quickly."

1

u/randomguy186 Apr 08 '16

Made me laugh.

12

u/gimpwiz Apr 07 '16

I worked for intel... we would have around a thousand bugs fixed between A0 and A1, A1 and A2 or B0, etc. If C0 or B2 shipped, don't think there were no bugs left to fix! The chip still shipped with quite a few bugs.

There were often entire sections of the chip that were dark because it was cheaper to try to get features in tomorrow's chip, but not critical, so if it didn't work it was simply turned off and would get included in next year's chip.

Still, the errata sheets for the chips are not small. There are also microcode updates to fix silicon errors, and microcode updates to fix microcode errors.

12

u/BobHogan Apr 07 '16

The hardware teams at Intel that design the microarchitecture of every virtually single desktop/laptop/server CPU would laugh at this notion. They have been doing this exact same thing, at a much wider scale, for decades.

Except that Intel processors have tons of bugs in them, this is just a short, 5 page list of bugs found in Haswell processors that Intel just doesn't care to fix. They acknowledge that they exist and just don't care to fix them. There are other bugs in addition to these that have been found and fixed since the processors were released. Their software isn't bug free.

→ More replies (2)

4

u/Weatherproof26 Apr 07 '16

I work at Micron Technology! That was kind of surprising to see. The engineer and article are right though, we are a for profit enterprise and while we take quality very seriously compared to other companies, at the end of the day we need to ship wafers/devices and can't be bottlenecked because of software that's not one hundred percent perfect.

15

u/pinealservo Apr 07 '16

This nearly 20-year-old article keeps making the rounds. I guess the message still resonates, but I don't think the example reflects the "most perfect" way we know how to achieve something in software. And ultimately, all systems incorporating software have a physical element as well; bringing the standard for software correctness too far above the standard for safety/robustness of the rest of the system is going to be time and money poorly spent. Despite the effort, the Shuttle Columbia still disintegrated upon reentry due to damage to heat shielding during lift-off. Not suggesting they made the wrong call with regard to the shuttle software design, just that the applicability of that approach to software projects in general is narrow.

We can and should do better at figuring out how to write robust software, or at least figuring out how to make systems incorporating software more robust in the face of software imperfection. And we need to actually put it into practice in the computer systems we deploy for real use. But this particular article is increasingly irrelevant; we have made progress in approaches since then, and the industry needs to know about those rather than some completely irrelevant approach taken by a super-safety-critical project with correspondingly high budget.

6

u/floider Apr 07 '16

What exactly is your alternative software development process that produces similar results but is much simpler and cheaper? You make several illusions to one existing but don't directly cite it.

5

u/nastharl Apr 07 '16

allusions.

→ More replies (1)

7

u/[deleted] Apr 07 '16

I get dismayed by the comments every time this is posted. It seems like every week we have some kind of post lamenting the state of the art and we all gather round to commiserate. "If only we had proper requirements" or "There just isn't enough time for unit tests; the managers want it yesterday!" I empathize. I really, really do.

Then something like this comes out an a lot of people (not all) get defensive.

I'll tell you what, I would trade the ping pong table, the free soda, seeing the company VP in jeans and a tee shirt, the super smash brothers in the lounge, hell, I would cut my salary in half - in a heart beat, for this kind of process and rigor.

3

u/scarytall Apr 08 '16

Ultimately this is a story of good engineering done well. They had a problem, and they solved it. It should be an encouraging story for anyone who loves engineering, and they are ways we can apply the lessons learned to our code, whether or not we have the same requirements.

One of the things I love about this story is that engineering done well is boring, in a good way. The careful application of sound practices leads to a predictable results, even when the problem is novel. Especially when the problem is novel.

This doesn't mean it's not fun or creative, but surprises are expensive and dangerous, especially when "excitement" is measured in body count.

→ More replies (1)

3

u/chain_letter Apr 07 '16

Quality, cost, and time. Pick 2.

1

u/scarytall Apr 08 '16

They chose quality and quality.

Edit: Saw someone already said this. Sorry. Not intentional.

3

u/spliznork Apr 08 '16

It certainly helps when the software has inherently crisply defined goals.

At least half of the problem in "consumer software" is it is searching for its user base and vision and core features and must remain flexible.

I feel this makes it fundamentally different. Consider trying to build a modern product and wasting months on the perfect implementation of the wrong feature.

3

u/marzolian Apr 08 '16

Richard Feynman took a look at how the shuttle software was written, and included it in his portion of the final report on the Challenger disaster.

It includes this famous line: "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled."

3

u/[deleted] Apr 08 '16

Of course this approach could not work for regular software because the requirements and needs can typically not be defined accurately up front. That is why we got things like Scrum in the first place because heavy upfront design leads to creation of lots of features which are never used or needed.

Control software like this deals with something which is very well defined.

What these guys are doing is more like engineering, while typical software is in some regards more like science. It is a lot about exploration and trying out things rather than building something according to some well defined rules.

7

u/KangstaG Apr 07 '16

I really enjoyed this article. Even if it's old, I still think most of it holds true for today. A lot of software is still in a 'wild west' phase where no one truly knows whats going on. You have new technologies and new paradigms like functional programming, design patterns, nodejs, docker, etc. where very few people understand how each one works. Most engineers just follow the hype. As long as you can do something with some new technology that works and earns money, you can use it. Colleges do a good job at teaching the fundamentals and theory of computer science, but software has moved so fast that what's taught in college is so far removed from how software is built in the real world.

Whenever I thought if some software process like agile scrum would work in all software environments, the one case where I always thought it wouldn't work out is in defense agencies or space programs where bug-free software is critical since any errors could be the crash of a hundred million dollar airplane. They've must have spent a lot of time nailing down processes to be able to produce bug-free software at a steady pace. I think all software shops could learn something from them.

5

u/SacredMotif Apr 07 '16

Yeah I was afraid I was the only person who enjoyed the article. It was a breath of fresh air in this slapdash coding world we live in today. Looking to the past may be just what we need in the industry.

1

u/strixvarius Apr 08 '16

Reading the article, I felt sorry for the "software engineers" who have to work in these conditions. No creativity, no flexibility, no autonomy. Basically translators from thousands of page of spec pseudo-code into actual-code. Ugh.

2

u/captainpatate Apr 08 '16 edited Apr 09 '16

Just for the record, functional programming is not a new paradigm. In fact it is older than most other paradigms...

11

u/hakkzpets Apr 07 '16

Why spend a billion dollars writing perfect software, when you can spend a million dollars writing "good enough" software?

Just employ an easy check list for what kind of bar you need:

  • Is there a high probability of loss of life if there is a bug? If yes, demand higher quality code.

  • Is there a high probability of big monetary loss if there is a bug? If yes, demand higher quality code.

  • Can the code be patched? If no, demand higher quality code.

It's pretty stupid to think everyone should stick to some "super quality code ethics" just because. There's a difference between sending a rocket to the moon and programming a remote control for your Pebble watch.

1

u/[deleted] Apr 07 '16

That's like saying to a bricklayer that the structure of the barn he is building doesn't matter as much as the house he built last week with rigorous attention to detail, because no one will live in the barn. And then it rains, and the farmer puts his cows in the barn, and they are killed by the barn falling down because of the high winds and weather. Wouldn't it just be better to make all buildings stand up strong, rather than slack and not care "just because you can"?

5

u/hakkzpets Apr 07 '16

Well, you just sort of hit all three of the points in the checklist why you would build a stronger house with your example...

Loss of life, high monetary loss and no ability to patch the later on.

But to go with your example, no it wouldn't be better to build the barn as good as the house your living in if it means spending either $100.000 or $1.000.000. You got to cut quality sometimes, otherwise you will just spend an insane amount of money for no other reason than to calculate for that 0,00001% risk that all hell will break loose.

3

u/killerguppy101 Apr 07 '16

Cows need granite countertops and Brazillian heartwood banisters too! They need every surface sanded, stained, and sealed to perfection; no splinters allowed. They deserve to sleep on individual Tempurpedic SleepNumber heated beds, each with their own room and moodlighting!

BovineLivesMatter

3

u/Someguy2020 Apr 07 '16

Is there a high probability of big monetary loss if there is a bug? If yes, demand higher quality code.

Losing all your cows would qualify as a big monetary loss.

1

u/[deleted] Apr 07 '16

What I'm trying to say is that by allowing the builder to cut corners, a completely acceptable usage of the barn becomes dangerous. However, if all buildings were built to high standards, this situation would never occur, and the barn could even be reused to store more than just cows and crops.

→ More replies (1)

1

u/[deleted] Apr 07 '16

Definitely not. Some good, useful software is even released into production with known bugs. Especially web applications since they can be patched and distributed seamlessly. This can be done in the interest of fast iteration and learning from your users, or any other number of reasons. It would be insane for a company like mine to spend the same attention to detail on our software as would an engineering team on a space shuttle. We'd be spending millions of non-existent dollars on edge cases for perfection, while our user base is mostly concerned with useful features and usability. Not to say our code is buggy crap; we do good code reviews and follow a rigorous deployment process, but we encounter bugs in production occasionally, and we fix them as they come because they don't blow up astronauts.

2

u/aiij Apr 07 '16

the last three versions of the program — each 420,000 lines long-had just one error each.

Does that mean they failed 3 times to correct the error, or that each time they fixed one of the errors they introduced a new one?

1

u/Focker_ Apr 07 '16

The risk of fixing that error and causing a new one that is worse can outweigh the benefit of fixing it.

2

u/salgat Apr 07 '16

"Our requirements are almost pseudo-code," says William R. Pruett, who manages the software project for NASA. "They say, you must do exactly this, do it exactly this way, given this condition and this circumstance."

I wouldn't mind that to be honest...

2

u/systembreaker Apr 07 '16

the group offers a set of textbook lessons

Did the author mean that to be figurative, or literal and if so, does anyone know what textbooks would that be?

2

u/[deleted] Apr 08 '16

Perfect software is really not the point. In general if a commercial organizations behaved in this way they would go bankrupt. People complain about bugs but there is always a balance between how quickly to release and how error free the software is.

I'm not claiming that most organizations couldn't improve their process, but the solution is not to act like NASA and I think if they had asked them many of the engineers there would agree. Although I will say I like the paragraphs about blame. A lot of times when something goes wrong in the corporate world the feeling is that a chewing out is in order. The fact is something is always likely to go wrong despite most of us putting in our best effort. The key thing is to learn from the mistake, identify what could have been done differently to prevent it.

Finally as far as the contrast between culture, I really don't think having stricter dress codes or schedules has anything to do with anything. They work for the government so that's typical. Although maybe they are better at managing their egos which is always a good thing.

2

u/GUI_Junkie Apr 08 '16

Just for the record, CMMI is based on this mythical "process". If companies would adopt CMMI they would 1) provide better software 2) go out of business because their clients would walk.

Source: I'm CMMI certified (not that I hold much value to certifications in general)

2

u/quad64bit Apr 08 '16

"If you bought a car with 5,000 defects, you'd be very upset." You do- they run on software :P

3

u/tolstoshev Apr 07 '16

You don't build a circus tent the same way you build the Brooklyn bridge - got it.

3

u/calspach Apr 07 '16

If I had 260 programmers to maintain 400,000 lines of code, it would be near perfect too. My group has about 50 programmers maintaining over 5 million lines of code. So yeah.

4

u/kabekew Apr 07 '16

When the article was written, there had only been 80 missions so that's the maximum number of times the software had run successfully. It's easy to declare your software "bug free" and "the best humans have ever written" based on only 80 times running on the same hardware. I think it's far more impressive Microsoft can push out updates to hundreds of millions of systems running different configurations and different hardware without the apparent catastrophic bugs you'd expect to be revealed with that number.

→ More replies (1)

3

u/vriley Apr 07 '16

Interestingly enough this is a waterfall approach to the extreme, write a thick spec document and agree to every minute detail, then pass on the task to the programmers and don't let them deviate from it.

Yet this method is argued by almost all programmers to be old school, no longer relevant to today's "Agile" model.

9

u/unregisteredusr Apr 07 '16

Waterfall works if the task is well known or the cost of experimenting is high. I'm sure it would work well if you were building the 8th CMS of the year, or if you had to ship code into space (though space x seems to have an agile process)

Also that code was written by 260 people, which is huge compared to most app teams of 10.

I don't think you can point to waterfall as the solution anymore than you can attribute their success to their use of HAL/S assembly language

3

u/ArtistEngineer Apr 07 '16

no longer relevant to today's "Agile" model.

That's like saying apples aren't relevant to oranges.

They're two different methods to achieve the same goal.

2

u/neutronbob Apr 08 '16

This article was written in 1996.

2

u/ishmal Apr 08 '16

Seen this article posted dozens of time. Worked there when this article was written. Knew those Lockheed guys. This is so fake, and so wrong. Just a bit of fluff from United Space Alliance and NASA PR.

1

u/Someguy2020 Apr 07 '16

edit: Just noticed the date. This makes a lot more sense now.

The most important things the shuttle group does — carefully planning the software in advance, writing no code until the design is complete, making no changes without supporting blueprints ... are not expensive. The process isn't even rocket science. Its standard practice in almost every engineering discipline except software engineering.

Actually it's extremely expensive and prone to failure.

NASA may be exceptionally good at what they do, but it's nothing like most commercial software. Notice that anecdote in the article, the man who quit and returned stated about his other job

But to Larson's way of thinking, the culture didn't focus on, well, the right stuff. "Speed there was the biggest thing," he says. "The engineers would say, these are our top priorities, and we need to get'em as fast as we can." But the impression Larson got was that engineers didn't seem too concerned about how well the finished software actually worked. "Basically, they wanted quick software — just put it out the door."

He's not wrong to think that's a poor way of doing things, but it does show the difference. Getting things done well enough and gettign them out the door is more important than perfection.

A better comparison would be a company like Toyota, who were in a situation where getting it right is more important and they failed pretty miserably.

1

u/[deleted] Apr 08 '16

I wonder if they use verified languages.
They seem to rely on manual testing, and excessive documentation, but that doesn't sound like enough.

Also, if every line of code has such excessive annotation, how is the code readable at all?

2

u/danltn Apr 08 '16

Yeah I agree, literally no mention of formal verification techniques or any formal methods at all.

I would trust a provably correct formally designed program over anything that comes out of the build/test process.

1

u/floider Apr 08 '16

Yeah I agree, literally no mention of formal verification techniques or any formal methods at all.

The Space Shuttle software was originally written in the 1970s. As far as I know that was long before much of the formal verification ideas begin and certainly before there were tools to do so.

Both methods have their places though: formal verification is great, but most of your problems with embedded control systems (essential function of the Shuttle computers) is from problems with interface specification, timing problems in the real system, problems in assumptions made, etc. The only way to find these is testing.

1

u/Choralone Apr 08 '16

The people writing it are experts at their domain. They took their time, planning things extensively. Not because they were overly complex, but because they were so important.

Think "write really simple software and debug the crap out of it"

1

u/[deleted] Apr 08 '16

Not convinced. Unreadable code can't be simple.
The situation they created means that no one is incentivized to understand the full picture, and that doing so is painful, as you swim in bloated, historical, partially non-technical comments.

I'll bet their low bug rate is mostly a reflection of low change rate.

1

u/ReversedGif Apr 27 '16

Why do you think the code is unreadable?

1

u/sffunfun Apr 08 '16

This article was in one of the original issues of Fast Company and helped the magazine get acclaim rather quickly.

1

u/luketheobscure Apr 08 '16

They had me up until the Alanis Morissette mention.

1

u/thistokenusername Apr 08 '16

I wonder what the one error was in the last version

1

u/serial_wanker Apr 08 '16

there is no such thing as "perfect" software

1

u/badjuice Apr 08 '16 edited Apr 08 '16

I'm reminded of the "UnkUnks", or rather, the unknown unknowns. TL;DR: You can never know if you are correct, you can't even know how incorrect you can possibly be, nor can you know what you need to know to avoid being incorrect. Fucking Turing devices.

Here, have an essay:

You have known knowns: these are things you know, that you know you know; or rather, your standard knowledge set.

You have the unknown knowns: these are things you know, that are relevant, but you fail to recall them or realize that these other pieces of knowledge you possess are relevant. For example, you might know a clever algorithm to calculate the inverse square root for lighting. You might not realize that this is usable for calculating gravity too. Unknown known.

You then have the known unknowns: the things that you don't know, but you are aware of your gap of knowledge. These are things you know you'll have to learn, implementation details or syntax or methodology/patterns that you are aware of, but are unable to use without learning further. For example, you might know that LISP dialects are good for processing behavior branches that are reversible on the merit that LISP dialects are generally stateless. You know that for an AI, you could use this, but you also know you'll have to learn Scheme or CLISP or some other variant.

Then finally, you have the unknown unknowns: These are the things you don't know, that you aren't even aware that you should know. Imagine programming an algebra equation evaluation program: if you are unaware of the concept of functional programming, and you attempt this in a more pure procedural or object-oriented fashion, there is great chance of running into bugs related to state (as you evaluate the equation in each iterative step, you measure a change in some value which is stored in said value's memory space; but then in a later iteration you need the old value, which has been overwritten). Unaware of functional programming/methodology (you can effectively functionally program in procedural languages if you watch your side effects, write pure functions, and represent your values by algorithmic determination instead of static value), you spend weeks plugging away at each of the little bugs you accidentally code in; unable to catch them until after you've moved on because those bugs are 'unk-unks': they arose from you not knowing what you failed to take into consideration. They require a large degree of extra manpower to get through because you have to look at their manifestation not just in the scope at which they effect, but the scope that created the system that created the bug- chances are, said bugs won't manifest until after they have effect, and so you will have to rewind through and step through the code, sifting for them. This is all due to the original unk-unk of not knowing that you don't know of a better way (functional programming) to manage the problems space.

Not only are you unaware of the better solution, or a more convenient path, but you are unaware that there even is a better way about it; until somebody clues you in, or your personal research reveals otherwise, you may well think that procedural logic is the way to go when it very probably isn't- you have a bad case of the unk-unk at a system level, and this will create unk-unks at the more granular level in the form of bugs that will be unknown to you; which come in forms that you are unable to identify / pre-empt. These are the bugs that slip through to production, that some guy reports because he's running x86-32 not x86-64 like one might assume is the common case (resulting in, for example, a small degree of resolution of floating point accuracy, which affects some assumption made in rounding and floating point math checks, which causes a sum of the cost of items totaling $3.00 to come out as $2.99 instead). These are bitches because the dude reporting the bug may not even know enough to even conceive that he should tell you he's 32 bit POSIX instead of 64 bit .NET; hell he may not even know what 32 bit means, he could just be some guy that got trained to use your software at a terminal workstation computer. No matter what, you can't replicate this situation because you don't know that you don't know that his bit-size is different, or that his OpSys API is different, and he doesn't know that he doesn't know what's wrong: he thinks your logic/program is dumb, you think it's perfectly fine, and it's because you both are having a bad case of the unk-unks.

This is why such things exist like automated testing, data-mining/auto-reporting for bugs, manual testing, implementation testing, code sanity rules, documentation standards, and all those other super fucking annoying things that nobody wants to write or do.

They are there to help you catch the unk-unks because you are just a feeble human who doesn't know everything, using a system that can measure every discrete possibility of behavior and then every permutation of those possibilities with every other permutation, testing landscapes you never even considered in your limited cognition, all for code produced in a standard that helps you, and more importantly, others figure out the logic of the code in retrospect, adopting rules that limit the possible things that the program can do and how it does them, so that hopefully, the problem space falls inside of the known unknowns, the known knowns, and the unknown knowns, because I will tell you what:

Nothing sucks more than finding out your bullet proof code has a hole in it, the exact shape and size of the actual use case the code is being used in, and you can't even see where the hole is.

Have you ever worked with a framework that just does this really weird thing that you don't quite get why it does that, so you code around it, then half a year later, you find out that there is a simple boolean flag you can pass with some config function that makes it operate the way you thought it should in the first place?

Have you ever looked at 6 months of git commits containing at least 50 manhours of pointless, sometimes buggy, generally problematic kludge-solutions that didn't even need to exist?

Fuck the unk-unks.

And fuck anybody that thinks they have produced code that is 'perfect' (please note that "perfect as human beings have achieved" is not the same as 'perfect'; not ripping on NASA here)- they have at the very least a huge unk-unk: they don't know that it is possible for them not to know what they don't know, and trust me, there is no recovery from that until you have that sobering day where you realize that you're as dumb as a human is and all code is shitty code (including yours) and all programming is only correct in a specific context that probably doesn't even line up to the context the code will be executed in. As an aside, the process of realizing this has resulted in at least two of my old junior coworkers deciding to go into project management instead of programming- they felt more comfortable managing the unk-unks implemented by others than writing code in a world where unk-unks exist.

I could be wrong though. I may just really like saying unk-unk.

Anywho, to produce code such as NASA's code, you gotta be super rigorous and absolutely methodical about form, description, executing system/environment, and every single other variable that exists from the clock-speed of the processor vs the clock speed of the bridge/bus (especially on multiple chip systems that are implemented at a low level), and test every single layer- they ran tests on their software running on test-hardware at every possible temperature and condition one could think of (at the lowest level) and they ran tests that were simply emulations of the total system by a super-computer (which was weaker than your cell phone, actually) for checking higher level environment in different scopes, and everything inbetween- they spend more time testing code than writing by a factor of perhaps 10 to achieve what they do... AND IT STILL HAS BUGS.

One bug that seriously fucked some shit up: http://www.cnn.com/TECH/space/9909/30/mars.metric.02/

Why? Because evidently metric and royal measurements are not the same, and nobody tested one piece of the software working with another piece in a live situation; they only tested by mocking up what they thought the other side would do/provide, because shit... what idiot would feed royal measurements to a program made for international scientific usage? Evidently, some idiot at NASA that makes way more money and is possibly much smarter than anybody reading this, that's who.

Unk unks and human fallacy suck. Test your code. Document. Adopt standards. Test your assumptions. Test your systems. Always assume there is a better way, just remember that the goal is "good enough", not "perfect"; lest you go insane (being that "perfect" is rather unattainable unless you truly had no unk-unks, and you literally cannot prove that in any system that operates the execution of your code underneath said system that all results and contexts are measured and evaluated and known: read up on the halting problem if you don't get why this is).

Actually, the halting problem is possibly the ur-example of unk-unk. You can't write a program to tell you if another program is correct. You cannot discretely verify correctness, therefor, you cannot know everything or even what the breadth of everything even is: It is logically unknown the knowledge of what can be known in any given context/system that is tasked to measure itself. You measuring yourself, by extension, cannot know when you have reached the end of what you can know.

You can never escape the unk-unks.

I'm gonna go find my roofing tools and switch careers now, I think.

1

u/Uberhipster Apr 08 '16

"*correct perfect as human beings have achieved"

1

u/paul_h Apr 08 '16

$24k per line of code if I recall correctly.

1

u/qoou Apr 08 '16

If I recall correctly, the space shuttle controller code was written at a rate of 1.2 lines of code per day*. In a non safety critical situation the process is waaaaay to heavy.

1

u/RedditRabbit69 Apr 08 '16

My engineering teacher helped write the code for that

1

u/sjmog Apr 08 '16

I suspect Martin Fowler and Thoughtwprks, one of the best Agile consultancies in the world, might have a few things to say about the bizarre dichotomies this article sets up all over the shot. Sure, great software-writing is 'boring', great code is 'dull' - but an overly-restrictive up-front design is not necessarily the right route to achieve this.

1

u/kamiikoneko Apr 07 '16

hahaha because cost wasn't an issue and profit didn't matter. This article is so out of touch.

→ More replies (1)

1

u/R4vendarksky Apr 07 '16

Did anyone make it through this article? Does it EVER actually tell you anything about their approach? I lost heart about 20 paragraphs in.

1

u/requimrar Apr 07 '16

I'm a bit late to the party, and this isn't related to programming at all, but... what exactly are the noxious fumes being exhaled here?

AFAIK the space shuttle uses LH2/LO2 as propulsion, so the only vapour is either hydrogen gas or oxygen gas -- even the exhaust is basically water.

The SRBs are also... well, solid, so those shouldn't be fuming at all.

2

u/HorseyMan Apr 08 '16

I think it uses hydrazine for it's steering thrusters. If so, it's rather nasty.

1

u/requimrar Apr 08 '16

ah yes it probably does, i remember. still, the entire draw of hydrazine is that it's storable as liquid without needing cryogenics, so it shouldn't be fuming at all...

1

u/technical_guy Apr 08 '16

ok, I call bullshit. About 15 years ago, I worked as the project lead on a large system directly reporting to General Jed Pearson at Lockheed Martin (the guy who previously ran Nasa), and I told him I needed 2 more weeks to put our system live on May 1st, which had the perfect set of circumstances for data conversion, and also gave me a little more slack in dotting the i's and crossing the t's in the testing.

He told me "I ran NASA and your fucking software has needed more fucking testing that we fucking did for the fucking space shuttle. You better not miss this fucking deadline". Needless to say, when he got angry, you got the point!!

So, from the horses mouth - my software was tested better than the software on the shuttle, so I claim an even higher level of perfection.

RIP Jed http://patch.com/california/sanjuancapistrano/obituary-major-general-jeremiah-jed-pearson-iii

1

u/athaliar Apr 08 '16

How is this still relevant ? It's from 1996

1

u/notchent Apr 08 '16

Well defined ideas are not automatically invalidated just because they're not new.

1

u/p7r Apr 08 '16

One of my issues with using NASA as a bar on software development is that their constraints don't change. The biggest problem they have to deal with is the laws of physics: the laws of physics are unlikely to change between now and launch, so you can specify how your code is going to run. The errors cited in this article are entirely mathematical or related to "pure" physics and engineering.

In a normal coding shop, you can't spec. You release something today, your competitors release something next week, you have to respond, you need to move quickly. The spec has to be light, because you know you are going to change it again in a few weeks time when your competitors respond.

It's only when your "universe" is entirely known, because your problem domain is fixed (launching and controlling a rocket), or you have the ability to entirely dictate the problem domain (you have a monopoly of market share, a la Google or Facebook), you can go back and lock down and extract a spec and build "perfect" software.

If you can't do that, you sort of have to run quickly and break things, otherwise the competitors doing that instead of you will quite possibly innovate quicker and get market share before you do.

-2

u/logicalmaniak Apr 07 '16 edited Apr 08 '16

Shuttles is it, now? There was a joke going around when I was a kid, that NASA stood for Not Another Shuttle Accident...

Edit. I see why you've downvoted me. Sorry for the historical inaccuracy, folks!

It really stood for Need Another Seven Astronauts...