Abstraction in Assertion-Based Test Oracles

Yoonsik Cheon
{"title":"Abstraction in Assertion-Based Test Oracles","authors":"Yoonsik Cheon","doi":"10.1109/QSIC.2007.10","DOIUrl":null,"url":null,"abstract":"Assertions can be used as test oracles. However, writing effective assertions of right abstraction levels is difficult because on the one hand, detailed assertions are preferred for thorough testing (i.e., to detect as many errors as possible), but on the other hand abstract assertions are preferred for readability, maintainability, and reusability. As assertions become a practical tool for testing and debugging programs, this is an important and practical problem to solve for the effective use of assertions. We advocate the use of model variables - specification-only variables of which abstract values are given as mappings from concrete program states - to write abstract assertions for test oracles. We performed a mutation testing experiment to evaluate the effectiveness of the use of model variables in assertion-based test oracles. According to our experiment, assertions written in terms of model variables are as effective as assertions written without using model variables in detecting (injected) faults, and the execution time overhead of model variables are negligible. Our findings are applicable to other use of runtime checkable assertions.","PeriodicalId":136227,"journal":{"name":"Seventh International Conference on Quality Software (QSIC 2007)","volume":"91 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2007-10-11","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"18","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Seventh International Conference on Quality Software (QSIC 2007)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/QSIC.2007.10","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 18

Abstract

Assertions can be used as test oracles. However, writing effective assertions of right abstraction levels is difficult because on the one hand, detailed assertions are preferred for thorough testing (i.e., to detect as many errors as possible), but on the other hand abstract assertions are preferred for readability, maintainability, and reusability. As assertions become a practical tool for testing and debugging programs, this is an important and practical problem to solve for the effective use of assertions. We advocate the use of model variables - specification-only variables of which abstract values are given as mappings from concrete program states - to write abstract assertions for test oracles. We performed a mutation testing experiment to evaluate the effectiveness of the use of model variables in assertion-based test oracles. According to our experiment, assertions written in terms of model variables are as effective as assertions written without using model variables in detecting (injected) faults, and the execution time overhead of model variables are negligible. Our findings are applicable to other use of runtime checkable assertions.
基于断言的测试oracle中的抽象
断言可以用作测试预言机。然而,编写正确抽象级别的有效断言是困难的,因为一方面,详细的断言更适合于彻底的测试(即,尽可能多地检测错误),但另一方面,抽象断言更适合于可读性、可维护性和可重用性。随着断言成为测试和调试程序的实用工具,为了有效地使用断言,这是一个需要解决的重要而实际的问题。我们提倡使用模型变量(仅规范变量,其抽象值作为具体程序状态的映射给出)为测试oracle编写抽象断言。我们执行了一个突变测试实验,以评估在基于断言的测试oracle中使用模型变量的有效性。根据我们的实验,在检测(注入)错误时,根据模型变量编写的断言与不使用模型变量编写的断言一样有效,并且模型变量的执行时间开销可以忽略不计。我们的发现适用于运行时可检查断言的其他使用。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术官方微信