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?
|
|
# ¿ Mar 22, 2024 15:52 |
|
|
# ¿ May 14, 2024 21:04 |
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.
|
|
# ¿ Mar 22, 2024 16:41 |