arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2204.02541eess.SYcs.ROcs.SY
收藏

迈向更好的测试覆盖率:自治系统的合并单元测试

Towards Better Test Coverage: Merging Unit Tests for Autonomous Systems

California Institute of Technology(加州理工学院)

Josefine Graebener, Apurva Badithela, Richard M. Murray

摘要:

我们提出了一个框架,合并单元测试的自治系统。通常,在其操作环境中针对每个场景测试自治系统是棘手的。是否有可能设计一个单一的测试系统的多个要求的问题,激励这项工作。首先,我们正式定义了测试的三个属性:测试规范,它描述了测试执行中观察到的行为,测试环境和测试策略。利用基于契约设计理论中的合并算子,我们给出了一种从两个单元测试规范中构造合并测试规范的形式化方法。合并测试规范上的时间约束保证了两个单元测试规范的非平凡满足对于成功的合并测试执行是必要的。我们假设测试环境在单元测试和合并测试中保持不变。给定一个测试规范和测试环境,我们合成一个测试策略过滤器使用滚动时域方法,并使用测试策略过滤器来指导搜索过程(例如蒙特卡洛树搜索),以找到一个测试策略,保证满足测试规范。这个搜索过程找到一个测试策略,最大限度地提高了预定义的鲁棒性度量的测试,而过滤器保证满足测试规范的测试策略。我们证明了我们的算法是合理的。此外,滚动时域方法合成的过滤器,确保我们的算法是可扩展的。最后,我们证明了合并单元测试对于设计高效的测试活动是有影响的,可以在更少的测试执行中实现相似的覆盖水平。我们在离散状态设置中的两个自动驾驶示例上说明了我们的框架。

英文摘要:

We present a framework for merging unit tests for autonomous systems. Typically, it is intractable to test an autonomous system for every scenario in its operating environment. The question of whether it is possible to design a single test for multiple requirements of the system motivates this work. First, we formally define three attributes of a test: a test specification that characterizes behaviors observed in a test execution, a test environment, and a test policy. Using the merge operator from contract-based design theory, we provide a formalism to construct a merged test specification from two unit test specifications. Temporal constraints on the merged test specification guarantee that non-trivial satisfaction of both unit test specifications is necessary for a successful merged test execution. We assume that the test environment remains the same across the unit tests and the merged test. Given a test specification and a test environment, we synthesize a test policy filter using a receding horizon approach, and use the test policy filter to guide a search procedure (e.g. Monte-Carlo Tree Search) to find a test policy that is guaranteed to satisfy the test specification. This search procedure finds a test policy that maximizes a pre-defined robustness metric for the test while the filter guarantees a test policy for satisfying the test specification. We prove that our algorithm is sound. Furthermore, the receding horizon approach to synthesizing the filter ensures that our algorithm is scalable. Finally, we show that merging unit tests is impactful for designing efficient test campaigns to achieve similar levels of coverage in fewer test executions. We illustrate our framework on two self-driving examples in a discrete-state setting.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑