r/programming • u/ekser • 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-stuff37
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:
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.
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.
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
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.
9
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
5
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
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
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
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
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
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:
Develop Requirements, know your capabilities, plan, proofs.
Code, peer review, test units, integration tests.
Version control and blame chain.
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
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
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
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
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
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.
→ More replies (2)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.
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.
→ More replies (1)5
7
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.
→ More replies (1)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.
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
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
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
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
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
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
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
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
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
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
1
1
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
1
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
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...
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:
Its usefulness is predicated on it being (almost/hopefully) bug-free, moreso than desktop, server, or web applications.
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?