<p>A system for detecting anomalies includes a first hardware system and a first run-time environment. The first hardware system generates outputs. The first runtime environment has a bi-directional link to an integrated development environment. The first run-time environment includes a first control system, a first diagnostic agent, and a second diagnostic agent. The first control system controls the hardware system through control inputs to the hardware system. The first diagnostic agent detects anomalies in the hardware system. The second diagnostic agent detects anomalies in the control system. A method of detecting anomalies in a system including an integrated development environment and a run-time environment bi-directionally linked by a link includes partitioning the run-time environment into at least one operational region; learning normal operating behaviors within the operational region; monitoring current operating behaviors within the operational region during operation of the system; comparing the current operating behaviors to the normal operating behaviors; detecting anomalies when a deviation exists between the current operating behaviors and the normal operating behaviors; tracing the anomalies back to the integrated development environment; and identifying the anomalies in the integrated development environment based on the tracing of the anomalies.</p>