Extracting QuickCheck specifications from EUnit test cases

T. Arts, Pablo Lamela Seijas, S. Thompson
{"title":"Extracting QuickCheck specifications from EUnit test cases","authors":"T. Arts, Pablo Lamela Seijas, S. Thompson","doi":"10.1145/2034654.2034666","DOIUrl":null,"url":null,"abstract":"Writing EUnit tests is more common than writing QuickCheck specifications, although QuickCheck specifications potentially explore far more scenarios than manually written unit tests. In particular for implementations that have side-effects, writing a good set of EUnit tests is often difficult and labour intensive. In this paper we report on mechanisms to extract QuickCheck specifications from EUnit test suites. We use the QSM algorithm to infer state machines from sets of positive and negative traces derived from the test suite. These traces can be derived either statically or dynamically and we describe both approaches here. Finally we show how to move from the inferred state machine to a QuickCheck state machine. This QuickCheck state machine can then be used to generate tests, which include the EUnit tests, but also include many new and different combinations that can augment the test suite. In this way, one can achieve substantially better testing with little extra work.","PeriodicalId":331264,"journal":{"name":"Proceedings of the 10th ACM SIGPLAN workshop on Erlang","volume":"72 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2011-09-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"9","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 10th ACM SIGPLAN workshop on Erlang","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2034654.2034666","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 9

Abstract

Writing EUnit tests is more common than writing QuickCheck specifications, although QuickCheck specifications potentially explore far more scenarios than manually written unit tests. In particular for implementations that have side-effects, writing a good set of EUnit tests is often difficult and labour intensive. In this paper we report on mechanisms to extract QuickCheck specifications from EUnit test suites. We use the QSM algorithm to infer state machines from sets of positive and negative traces derived from the test suite. These traces can be derived either statically or dynamically and we describe both approaches here. Finally we show how to move from the inferred state machine to a QuickCheck state machine. This QuickCheck state machine can then be used to generate tests, which include the EUnit tests, but also include many new and different combinations that can augment the test suite. In this way, one can achieve substantially better testing with little extra work.
从EUnit测试用例中提取QuickCheck规范
编写EUnit测试比编写QuickCheck规范更常见,尽管QuickCheck规范可能比手动编写单元测试探索更多的场景。特别是对于有副作用的实现,编写一组好的EUnit测试通常是困难的,而且需要大量的劳动。在本文中,我们报告了从EUnit测试套件中提取QuickCheck规范的机制。我们使用QSM算法从来自测试套件的正轨迹和负轨迹集推断状态机。这些轨迹既可以静态导出,也可以动态导出,我们在这里描述这两种方法。最后,我们将展示如何从推断状态机转移到QuickCheck状态机。然后,这个QuickCheck状态机可以用来生成测试,其中包括EUnit测试,但也包括许多可以扩展测试套件的新的和不同的组合。通过这种方式,人们可以用很少的额外工作实现更好的测试。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
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学术文献互助群
群 号:481959085
Book学术官方微信