Towards Better Test Coverage: Merging Unit Tests for Autonomous Systems

Josefine B. Graebener, Apurva Badithela, R. Murray
{"title":"Towards Better Test Coverage: Merging Unit Tests for Autonomous Systems","authors":"Josefine B. Graebener, Apurva Badithela, R. Murray","doi":"10.48550/arXiv.2204.02541","DOIUrl":null,"url":null,"abstract":"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.","PeriodicalId":436677,"journal":{"name":"NASA Formal Methods","volume":"154 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-04-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"NASA Formal Methods","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.48550/arXiv.2204.02541","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3

Abstract

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.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
迈向更好的测试覆盖率:合并自治系统的单元测试
我们提出了一个为自治系统合并单元测试的框架。通常,在操作环境中为每个场景测试一个自治系统是很棘手的。是否有可能为系统的多个需求设计单个测试的问题激发了这项工作。首先,我们正式定义测试的三个属性:描述在测试执行中观察到的行为的测试规范、测试环境和测试策略。使用基于契约的设计理论中的合并操作符,我们提供了一种形式化的方法来从两个单元测试规范中构造合并的测试规范。合并测试规范的时间约束保证了两个单元测试规范的非平凡的满足对于成功的合并测试执行是必要的。我们假设测试环境在单元测试和合并测试之间保持相同。在给定测试规范和测试环境的情况下,我们使用后退水平方法合成了一个测试策略过滤器,并使用测试策略过滤器指导搜索过程(例如Monte-Carlo树搜索)来找到保证满足测试规范的测试策略。这个搜索过程找到一个测试策略,该测试策略最大化了测试的预定义健壮性度量,而过滤器保证了满足测试规范的测试策略。我们证明了我们的算法是合理的。此外,采用视界后退法合成滤波器,保证了算法的可扩展性。最后,我们展示了合并单元测试对于设计有效的测试活动,在更少的测试执行中达到相似的覆盖水平是有影响的。我们在离散状态设置的两个自动驾驶示例中说明了我们的框架。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Multi-Objective Task Assignment and Multiagent Planning with Hybrid GPU-CPU Acceleration A Linear Weight Transfer Rule for Local Search Automata-Based Software Model Checking of Hyperproperties Strategy Synthesis in Markov Decision Processes Under Limited Sampling Access Formalizing Piecewise Affine Activation Functions of Neural Networks in Coq
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1