We describe an approach to automatically locating faulty statements in control code in embedded systems. Our approach uses the controller structure and examples of normal behavior in simulation to build structured probabilistic models that compactly encode the dynamic behavior of the system. Given an anomalous behavior sequence, we analyze the values of system state variables to determine which variables are responsible for the behavior. We use the variables obtained in this way together with the dynamic program dependence graph to determine a small set of potential causes (faulty statements) of the behavior, which are then ranked and presented to the developer. We evaluate our approach on the control systems for two prototype robotic surgery systems developed in our lab and demonstrate its ability to locate faults causing adverse and anomalous events during the systems' operation.
展开▼