Control software of autonomous mobile robots comprises a number of software modules which show very rich behaviors and interact in a very complex manner. These facts among others have a strong influence on the robustness of robot con- trol software in the field. In this paper we present an approach which is able to automatically derive a model of the structure and the behavior of the communication within a component- orientated control software. Such a model can be used for on-line model-based diagnosis in order to increase the robust- ness of the software by allowing the robot to autonomously cope with faults occurred during runtime. Due to the fact that the model is learned form recorded data and the use of the popular publisher-subscriber paradigm the approach can be applied to a wide range of complex and even partially un- known systems.