Testing and simulation monitor for train systems : A case study in software engineering and design