Live data from Hacker News

A Look into NASA’s Coding Philosophy

mystudentvoices.com

41–50 of 57 posts

Re: A Look into NASA’s Coding Philosophy

#41
The article severely misrepresents Amdahl's law, in particular in the sentence:

> Though you took half of your entire program, and optimized it to be four times faster, the overall system is only 1.6x faster.

This application of Amdahl's law doesn't tell you anything about what happens when you take half of the program; it tells you what happens when you take half of the execution time. If you only get a 1.6x speedup, it means you optimized the wrong part of the program!

Suppose 20% of the program is responsible for 80% of the execution time. If you speed up this bit four times, you end up with a 2.5x speedup (and not a 1.18x speedup as the article tries to imply).

Re: A Look into NASA’s Coding Philosophy

#42
post #40

Earlier quoted context omitted.

DO-178B was one of best things to happen in software assurance. It was a non-prescriptive method of certification that forced precise requirements, design, and code with reviews of each and tracability between them. The high cost of certification and certification failure led to a booming ecosystem of supporting tools (esp static analysis or runtimes) and pre-made components (esp RTOS's & middleware). Some companies…

Applied very narrowly to the right problem, maybe. But I have also seen DO-178B to lead to a completely non-maintainable mess. That mess helps trace each statement to a requirement, but leads to code that is unreadable to anyone used to normal code. It is not that "no extra code" and exactly meeting requirements is a bad model in itself. However writing code in a way that makes it convenient to prove the above encour…

This happens a lot. IMO, the best method to mitigate this is to design and write your code base to the system requirements rather than try to perfect the low level requirements before writing any code.

You can then reverse-engineer the low level requirements from source, deriving your verbiage from the system requirements and logic from the actual code. This way your low-level/unit testing is precise and verifiable while also ensuring strong traceability up and down the chain.

If there ends up being low level requirements/code that don't trace up to the system for some reason, then either there's been a disconnect between design and execution or, if not, you make the case for a derived requirement.

Re: A Look into NASA’s Coding Philosophy

#43
post #3

This article is very much at odds with my 15-year (1988-2000, 2001-2004) experience writing software at NASA (albeit at JPL, which is to say the unmanned space program, but still NASA). In my experience there was just as much politics, marketing hype, and general bullshit as I've seen in the commercial world. It was actually pretty amazing to me some times that things worked at all, let alone that they worked as well…

The author is young, and has been there for 3 years. I'm guessing this is anecdotal, and he happens to have had a good experience. Always possible things have improved though?

The fundamental truth that must be considered of any article like this is "YMMV". (Your mileage may vary)

Especially in a big organization, things are different depending on the division you're in and where you work. I work at a large .gov institution and am only here a decade later because my leadership team in the early days were great bosses and amazing mentors. They taught me a lot both in a professional and personal level. I aspire and in many ways fail to be the same.

I look at other parts of the organization and see great places as well divisions where employees are treated like crap and are demoralized to the point of depression.

Working in a "good part" of a big company or institution can be amazing.

Re: A Look into NASA’s Coding Philosophy

#44
post #39
post #3

This article is very much at odds with my 15-year (1988-2000, 2001-2004) experience writing software at NASA (albeit at JPL, which is to say the unmanned space program, but still NASA). In my experience there was just as much politics, marketing hype, and general bullshit as I've seen in the commercial world. It was actually pretty amazing to me some times that things worked at all, let alone that they worked as well…

> ... they test the living shit out of it. Then, once it's working, they don't change it except under extreme pressure. I wonder if self-driving car manufacturers will apply this same philosophy.

[deleted]

Re: A Look into NASA’s Coding Philosophy

#45
post #40

Earlier quoted context omitted.

Applied very narrowly to the right problem, maybe. But I have also seen DO-178B to lead to a completely non-maintainable mess. That mess helps trace each statement to a requirement, but leads to code that is unreadable to anyone used to normal code. It is not that "no extra code" and exactly meeting requirements is a bad model in itself. However writing code in a way that makes it convenient to prove the above encour…

This happens a lot. IMO, the best method to mitigate this is to design and write your code base to the system requirements rather than try to perfect the low level requirements before writing any code. You can then reverse-engineer the low level requirements from source, deriving your verbiage from the system requirements and logic from the actual code. This way your low-level/unit testing is precise and verifiable w…

I agree that the left hand side of the Vee has to be seen as a two way street. As we develop the code we gain experience and insights which enable us to elaborate and refine our requirements. The requirements then act both to guide the development of the system and also to document the lessons that have been learned during development. The output of early requirements elaboration phases are then draft, rather than final, requirements sets.

The key, for me, is the tooling that we have around maintaining requirements and the traces between them and the code. I think that it should be possible to navigate traces and update (low level) requirements and test specifications without leaving the text editor. If it takes 5 minutes to open DOORS and to find the relevant requirement, then you aren't likely to keep it as up to date as you should. The same is true if the requirements are stored on a spreadsheet in a document management system.

Some ALM/IDE tools may enable you to manage things in a better way. From what I have seen, mbeddr is a really interesting experiment along these lines. I also suspect that Visual Studio and Eclipse have some pretty powerful features in this regard.

In my side project (and purely for my own 'entertainment') I am experimenting with ways of embedding low level requirements into comments in the code (the build extracts them and can update DOORS or some other tool), as well as a generic trace system that allows different classes of traceable item to be defined and indexed. The build can enforce requirements coverage in the same way that it enforces test coverage, and because the text and metadata of requirements is easily accessible to the build, we can use NLP tools to enforce the use of restricted natural language or DSLs in the requirements text. The ultimate goal being to use machine learning to learn the correlation between requirements changes and code changes so that a change in one can help generate advice and guidance on what needs to change in the other.

Re: A Look into NASA’s Coding Philosophy

#46
post #19

Earlier quoted context omitted.

On that note, what language(s) are SpaceX, Tesla built on? Job postings I see a mix of C# and golang. I cannot believe either a Model X or a rocket is rockin C#...

Probably not on the rocket itself, but C# is a very common language for ancillary testing tools in the industrial automation world. I wouldn't be surprised if a lot of their test infrastructure is written in C#.

Pity. I've been using Python a lot for test infrastructure and it fits really well.

Re: A Look into NASA’s Coding Philosophy

#47
post #39
post #3

This article is very much at odds with my 15-year (1988-2000, 2001-2004) experience writing software at NASA (albeit at JPL, which is to say the unmanned space program, but still NASA). In my experience there was just as much politics, marketing hype, and general bullshit as I've seen in the commercial world. It was actually pretty amazing to me some times that things worked at all, let alone that they worked as well…

> ... they test the living shit out of it. Then, once it's working, they don't change it except under extreme pressure. I wonder if self-driving car manufacturers will apply this same philosophy.

They're gonna have to. The first self-driving fatality (that isn't the fault of the driver or nearby drivers) is going to very severely impact any self-driving car manufacturer's brand.

Re: A Look into NASA’s Coding Philosophy

#48
post #8

Earlier quoted context omitted.

Reasonable if you ignore maintainability and standards compliance. Not a coder, but if you used an idiom that worked because of a compiler quirk then that could lead to problems down the line but related to maintenance per se , hence why I added the second part.

In any mission critical situation the entire tool chain is just as locked down and controlled as the "source code," even down to the silicon.

the ISS laptops run on commodity hardware and software, often undocumented, and from my interview with that team the notion that they have some fully deterministic system set up for their operations is horrendously false, and they've run into many issues because of it

Re: A Look into NASA’s Coding Philosophy

#49
post #41

The article severely misrepresents Amdahl's law, in particular in the sentence: > Though you took half of your entire program, and optimized it to be four times faster, the overall system is only 1.6x faster. This application of Amdahl's law doesn't tell you anything about what happens when you take half of the program; it tells you what happens when you take half of the execution time . If you only get a 1.6x speedu…

Basically this. The article makes it sound like "optimizing half the program" means "optimizing half of the codebase", not "optimizing a part of the codebase that consumes 50% of the execution time."

This quote is especially misleading:

> Amdahl’s Law is telling us that to significantly improve the speed of a system, we’ll have to improve a very large fraction of it.

No, it's telling us we'll have to improve the part of it which is responsible for a very large fraction of the execution time. Often this is only a tiny amount of the overall codebase.

Re: A Look into NASA’s Coding Philosophy

#50

Earlier quoted context omitted.

The author is young, and has been there for 3 years. I'm guessing this is anecdotal, and he happens to have had a good experience. Always possible things have improved though?

The fundamental truth that must be considered of any article like this is "YMMV". (Your mileage may vary) Especially in a big organization, things are different depending on the division you're in and where you work. I work at a large .gov institution and am only here a decade later because my leadership team in the early days were great bosses and amazing mentors. They taught me a lot both in a professional and pers…

This is one of the best-chosen comments in the thread. The OP has encouraged commenters here to make generalizations about "NASA" software, but this does not make sense. It's too big, too dispersed, and the software developed is in a big range from research codes to operational codes to human-rated (see upthread: https://news.ycombinator.com/item?id=14886727).

In short, s/w practices and the dedication and capabilities of the people writing the software vary too much to characterize at that level of granularity.

Post reply on HN