用QuickCheck的组件库测试阻塞操作

U. Norell, Hans Svensson, T. Arts
{"title":"用QuickCheck的组件库测试阻塞操作","authors":"U. Norell, Hans Svensson, T. Arts","doi":"10.1145/2505305.2505310","DOIUrl":null,"url":null,"abstract":"It is a challenge to write test cases for software with blocking operations, i.e. operations that do not return until data become available. One should prevent the test case itself to block, whereas at the same time, one wants to test the blocking behaviour. Therefore, the standard solution is to write concurrent test cases, each call in the test case executed by a newly spawned process, together with a lot of boilerplate code. Manually crafted test cases can check that blocking calls are indeed blocked and unblocked as expected. Writing such test cases is error-prone and covering all interesting cases requires a lot of manually written tests.\n By using QuickCheck?s state machines one can automatically generate the test cases from a specification, but also here the boilerplate code is needed. We demonstrate that by using the component library in QuickCheck, an extension of the state machine formalism, the boilerplate code is no longer needed. Using the component library results in clear and concise specifications that are effectively used for testing. By using this new library, software with blocking operations can be tested much more thoroughly than by using a manual test approach.","PeriodicalId":140676,"journal":{"name":"Erlang Workshop","volume":"80 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2013-09-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"6","resultStr":"{\"title\":\"Testing blocking operations with QuickCheck's component library\",\"authors\":\"U. Norell, Hans Svensson, T. Arts\",\"doi\":\"10.1145/2505305.2505310\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"It is a challenge to write test cases for software with blocking operations, i.e. operations that do not return until data become available. One should prevent the test case itself to block, whereas at the same time, one wants to test the blocking behaviour. Therefore, the standard solution is to write concurrent test cases, each call in the test case executed by a newly spawned process, together with a lot of boilerplate code. Manually crafted test cases can check that blocking calls are indeed blocked and unblocked as expected. Writing such test cases is error-prone and covering all interesting cases requires a lot of manually written tests.\\n By using QuickCheck?s state machines one can automatically generate the test cases from a specification, but also here the boilerplate code is needed. We demonstrate that by using the component library in QuickCheck, an extension of the state machine formalism, the boilerplate code is no longer needed. Using the component library results in clear and concise specifications that are effectively used for testing. By using this new library, software with blocking operations can be tested much more thoroughly than by using a manual test approach.\",\"PeriodicalId\":140676,\"journal\":{\"name\":\"Erlang Workshop\",\"volume\":\"80 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2013-09-28\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"6\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Erlang Workshop\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/2505305.2505310\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Erlang Workshop","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2505305.2505310","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 6

摘要

为带有阻塞操作的软件编写测试用例是一个挑战,例如,在数据可用之前不返回的操作。人们应该防止测试用例本身阻塞,而同时,人们想要测试阻塞行为。因此,标准的解决方案是编写并发测试用例,测试用例中的每个调用由新生成的进程执行,以及大量的样板代码。手工制作的测试用例可以检查阻塞调用是否确实如预期的那样被阻塞和未阻塞。编写这样的测试用例很容易出错,并且覆盖所有有趣的用例需要大量手工编写的测试。通过使用QuickCheck?在S状态机中,可以根据规范自动生成测试用例,但这里也需要样板代码。通过使用QuickCheck中的组件库(状态机形式化的扩展),我们将演示不再需要样板代码。使用组件库会产生清晰而简洁的规范,可以有效地用于测试。通过使用这个新的库,可以比使用手动测试方法更彻底地测试具有阻塞操作的软件。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Testing blocking operations with QuickCheck's component library
It is a challenge to write test cases for software with blocking operations, i.e. operations that do not return until data become available. One should prevent the test case itself to block, whereas at the same time, one wants to test the blocking behaviour. Therefore, the standard solution is to write concurrent test cases, each call in the test case executed by a newly spawned process, together with a lot of boilerplate code. Manually crafted test cases can check that blocking calls are indeed blocked and unblocked as expected. Writing such test cases is error-prone and covering all interesting cases requires a lot of manually written tests. By using QuickCheck?s state machines one can automatically generate the test cases from a specification, but also here the boilerplate code is needed. We demonstrate that by using the component library in QuickCheck, an extension of the state machine formalism, the boilerplate code is no longer needed. Using the component library results in clear and concise specifications that are effectively used for testing. By using this new library, software with blocking operations can be tested much more thoroughly than by using a manual test approach.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信