论文标题
寻求更好的测试覆盖范围:合并自主系统的单元测试
Towards Better Test Coverage: Merging Unit Tests for Autonomous Systems
论文作者
论文摘要
我们提出了合并自主系统单元测试的框架。通常,在其操作环境中的每种情况下测试一个自主系统是很棘手的。是否可以针对系统的多个要求设计单个测试的问题激发了这项工作。首先,我们正式定义了测试的三个属性:测试规范,该规范表征了在测试执行,测试环境和测试策略中观察到的行为。使用基于合同设计理论的合并操作员,我们提供了一种形式主义,可以从两个单位测试规范中构建合并的测试规范。合并测试规范的时间约束保证,对于成功合并的测试执行,两种单元测试规格的非平凡满意度都是必要的。我们假设测试环境在整个单元测试和合并测试中保持不变。给定测试规范和测试环境,我们使用退缩的地平线方法合成测试策略过滤器,并使用测试策略过滤器指导搜索过程(例如蒙特 - 卡洛树搜索),以找到保证满足测试规范的测试策略。该搜索过程找到了测试策略,该策略最大化了预定义的鲁棒性指标,而过滤器保证了满足测试规范的测试策略。我们证明我们的算法是正确的。此外,合成过滤器的退化的地平线方法可确保我们的算法可扩展。最后,我们表明合并单元测试对设计有效的测试活动有影响,以在更少的测试执行中获得相似的覆盖范围。我们在离散状态的两个自动驾驶示例上说明了我们的框架。
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.