Finding Bugs with Specification-Based Testing is Easy!

Janice Chin, D. Pearce
{"title":"Finding Bugs with Specification-Based Testing is Easy!","authors":"Janice Chin, D. Pearce","doi":"10.22152/programming-journal.org/2021/5/13","DOIUrl":null,"url":null,"abstract":"Automated specification-based testing has a long history with several notable tools having emerged. For example, QuickCheck for Haskell focuses on testing against user-provided properties. Others, such as JMLUnit, use specifications in the form of preand post-conditions to drive testing. An interesting (and under-explored) question is how effective this approach is at finding bugs in practice. In general, one would assume automated testing is less effective at bug finding than static verification. But, how much less effective? To shed light on this question, we consider automated testing of programs written in Whiley—a language with first-class support for specifications. Whilst originally designed with static verification in mind, we have anecdotally found automated testing for Whiley surprisingly useful and cost-effective. For example, when an error is detected with automated testing, a counterexample is always provided. This has motivated the more rigorous empirical examination presented in this paper. To that end, we provide a technical discussion of the implementation behind an automated testing tool for Whiley. Here, a key usability concern is the ability to parameterise the input space, and we present novel approaches for references and lambdas. We then report on several large experiments investigating the tool’s effectiveness at bug finding using a range of benchmarks, including a suite of 1800+ mutants. The results indicate the automated testing is effective in many cases, and that sampling offers useful performance benefits with only modest reductions in bug-finding capability. Finally, we report on some real-world uses of the tool where it has proved effective at finding bugs (such as in the standard library).","PeriodicalId":224558,"journal":{"name":"Art Sci. Eng. Program.","volume":"33 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2021-02-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"2","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Art Sci. Eng. Program.","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.22152/programming-journal.org/2021/5/13","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 2

Abstract

Automated specification-based testing has a long history with several notable tools having emerged. For example, QuickCheck for Haskell focuses on testing against user-provided properties. Others, such as JMLUnit, use specifications in the form of preand post-conditions to drive testing. An interesting (and under-explored) question is how effective this approach is at finding bugs in practice. In general, one would assume automated testing is less effective at bug finding than static verification. But, how much less effective? To shed light on this question, we consider automated testing of programs written in Whiley—a language with first-class support for specifications. Whilst originally designed with static verification in mind, we have anecdotally found automated testing for Whiley surprisingly useful and cost-effective. For example, when an error is detected with automated testing, a counterexample is always provided. This has motivated the more rigorous empirical examination presented in this paper. To that end, we provide a technical discussion of the implementation behind an automated testing tool for Whiley. Here, a key usability concern is the ability to parameterise the input space, and we present novel approaches for references and lambdas. We then report on several large experiments investigating the tool’s effectiveness at bug finding using a range of benchmarks, including a suite of 1800+ mutants. The results indicate the automated testing is effective in many cases, and that sampling offers useful performance benefits with only modest reductions in bug-finding capability. Finally, we report on some real-world uses of the tool where it has proved effective at finding bugs (such as in the standard library).
基于规格的测试很容易发现bug !
基于规范的自动化测试有很长的历史,已经出现了几个著名的工具。例如,Haskell的QuickCheck侧重于针对用户提供的属性进行测试。其他的,比如JMLUnit,使用前置和后置条件形式的规范来驱动测试。一个有趣的问题是,这种方法在实际中发现bug的效率如何。一般来说,人们会认为自动化测试在发现bug方面不如静态验证有效。但是,效果会差多少呢?为了阐明这个问题,我们考虑对用while编写的程序进行自动化测试,while是一种对规范具有一流支持的语言。虽然最初设计时考虑的是静态验证,但我们发现自动化测试对Whiley来说非常有用,而且成本效益高。例如,当使用自动化测试检测到错误时,总是会提供反例。这促使本文提出更严格的实证检验。为此,我们提供了一个关于Whiley自动化测试工具背后实现的技术讨论。在这里,一个关键的可用性问题是参数化输入空间的能力,我们为引用和lambda提供了新的方法。然后,我们报告了几个大型实验,使用一系列基准测试来调查该工具在查找bug方面的有效性,其中包括一套1800多个突变体。结果表明,自动化测试在许多情况下是有效的,并且采样提供了有用的性能优势,只是在bug查找能力上略有降低。最后,我们将报告该工具的一些实际使用情况,在这些情况下,它已被证明能够有效地查找bug(例如在标准库中)。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术文献互助群
群 号:604180095
Book学术官方微信
小红书