Taming Dr. Frankenstein: contract-based design for cyber-physical systems