Cyber-Physical Systems (CPSs) software is used to enforce desired behaviours on physical systems. To test the interaction between the CPS software and the system's physics, engineers provide traces of desired physical states and observe traces of the actual physical states. CPS requirements describe how closely the actual physical traces should track the desired traces. These requirements are typically defined for specific, simple input traces such as step or ramp sequences, and thus are not applicable to arbitrary inputs. This limits the availability of oracles for CPSs. Our recent work proposes an approach to testing CPS using control-theoretical design assumptions instead of requirements. This approach circumvents the oracle problem by leveraging the control-theoretical guarantees that are provided when the design assumptions are satisfied. To address the test case generation and oracle problems, researchers have proposed metamorphic testing, which is based on the study of relations across tests, i.e., metamorphic relations (MRs). In this work, we define MRs based on the design assumptions and explore combinations of these MRs using genetic programming to generate CPS test cases. This enables the generation of CPS input traces with potentially arbitrary shapes, together with associated expected output traces. We use the deviation from the expected output traces to guide the generation of input traces that falsify the MRs. Our experiment results show that the MR-falsification provides engineers with new information, helping them identify passed and failed test cases. Furthermore, we show that the generation of traces that falsify the MRs is a non-trivial problem, which is successfully addressed by our genetic search.
翻译:信息物理系统(CPS)软件用于对物理系统实施期望的行为。为测试CPS软件与系统物理过程之间的交互,工程师提供期望物理状态的轨迹并观察实际物理状态的轨迹。CPS需求描述了实际物理轨迹应如何紧密跟踪期望轨迹。这些需求通常针对特定、简单的输入轨迹(如阶跃或斜坡序列)定义,因此不适用于任意输入。这限制了CPS测试预言的可获得性。我们近期研究提出了一种基于控制理论设计假设(而非需求)的CPS测试方法。该方法通过利用设计假设满足时所提供的控制理论保证,规避了预言问题。针对测试用例生成与预言问题,研究者提出了基于测试间关系(即蜕变关系)研究的蜕变测试方法。本研究基于设计假设定义蜕变关系,并利用遗传编程探索这些关系的组合以生成CPS测试用例。该方法能够生成具有任意潜在形状的CPS输入轨迹及其对应的期望输出轨迹。我们利用期望输出轨迹的偏差来指导生成能证伪蜕变关系的输入轨迹。实验结果表明,蜕变关系证伪为工程师提供了新信息,有助于识别通过和失败的测试用例。此外,我们证明生成证伪蜕变关系的轨迹是一个非平凡问题,而我们的遗传搜索方法成功解决了该问题。