Monitoring and Testing of Cyber-Physical Systems