Abstract
Cyber Physical Systems (CPSs), such as smart lifts, smart healthcare, collaborative robots and autonomous vehicles, are rapidly deployed on a large scale. As such CPSs are safety-critical, it is very important that they are thoroughly tested for safety, reliability and security. CPSs are hard to analyse due to high complexity and dynamic behaviour. As such, they carry high risks due to failed control. Testing is one method of managing the risks, by identifying bugs in the CPS control software. Model Based Testing (MBT) is a promising approach to CPS testing, but requires a valid, abstract test model of the CPS. It can be extremely challenging to manually model a CPS given that CPSs can have complex interactions between its cyber and physical components. Automated modelling of a CPS is therefore desirable. The research problem identified is the lack of a general, domain-independent framework to automatically model CPSs for the purpose of testing. Automated model generation can be broadly classified into active and passive automata learning. Research into automated model generation is centred on either one of these classes, and is domain-specific and fragmented. Practitioners lack a comprehensive, general and unified set of guidelines to apply automata learning to test CPSs. This thesis proposes a model based CPS testing framework, based on automated model generation. The framework is made up of four steps referred to as ABCD -(A)bstract the CPS, (B)uild the model, (C)heck the model for validity, and (D)eploy the model. Each of these steps is a critical to the development of an effective method for Model Based Testing of CPSs. The framework has been applied to multiple case studies. The first case study uses data collected from sensors mounted in an actual passenger lift. A time-based model which represented the lift motion and door states over time was built. This model was then formally model-checked to verify time-based properties stated in the lift’s specifications. The second case study actively controlled a programmable logic controller (PLC) which drives a scaled down lift. Certain bugs in the PLC’s source code were modelled in the form of fault models, which helped to debug the PLC. With this framework, practitioners gain a comprehensive, general and unified set of guidelines to apply automata learning to test CPSs. The theory and rigour of automata learning will become accessible to these practitioners, hence potentially raising the standard of CPS testing industry-wide. The framework can also serve as a prestandard for the testing and research of CPSs, as such a standard does not yet exist.