Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
M_Gargantua
Oct 16, 2006

STOMP'N ON INTO THE POWERLINES

Exciting Lemon
Here is a question from a non-programmer (me) about important high level professional programmer stuff -

The question is about some sort of "Best Practice" or Terminology that I'm probably unaware of, and not implementation specific.

We've got a control system that runs some safety critical stuff, it's worked great over the years, and is pretty well maintained code with frequent updates.

There is a new need to have a standalone simulation for testing and training, generating fake sensor data from its own program & plant model, to feed into the existing software. Currently we have a fork that can run the software on a PC instead, and then the user can manually feed it 1 sensor value at a time directly into memory for testing. This new one would add some sort of API or network hook to talk to the plant model software to create real time sensor data and feedback.

Is there any way to guarantee that all that simulation only hook/API code is outright inactive when you compile for prod? Because its tied to safety cases I want to avoid even the possibility that a bugged input could be off in lala land looking for a value from the plant model while its running on the real hardware, or worse, somehow the simulation only "Ignore Shutdown" logic sim only testing control is somehow entered.

I'm assuming its something to do with the compiler and include files, is there a standardized way to do that without introducing discrepancies between the actual control response of the two branches of code?

Adbot
ADBOT LOVES YOU

M_Gargantua
Oct 16, 2006

STOMP'N ON INTO THE POWERLINES

Exciting Lemon

KillHour posted:

Preprocessor directives

nielsm posted:

mocking code

Dijkstracula posted:

"separation of concerns" [...] "dependency injection".

Much appreciated. I'll be doing a lot of reading on these. I will never ever be touching the code, closest I get is submitting change requests to table values that the programmers use as sources. But this is plenty for me to research so I can better stress to program management the importance and ease of doing this right.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply