Towards property-based testing of RESTful web services

Pablo Lamela Seijas, Huiqing Li, S. Thompson
{"title":"Towards property-based testing of RESTful web services","authors":"Pablo Lamela Seijas, Huiqing Li, S. Thompson","doi":"10.1145/2505305.2505317","DOIUrl":null,"url":null,"abstract":"Developing APIs as Web Services over HTTP implies adding an extra layer to software, compared to the ones that we would \nneed to develop an API distributed as, for example, a library. \n \nThis additional layer must be included in testing too, but this implies that the software under test has an additional complexity due both to the need to use an intermediate protocol in tests and to the need to test compliance with the constraints imposed by that protocol: in this case the constraints defined by the REST architectural style. \n \nOn the other hand, these requirements are common to all the Web Services, and because of that, we should be able to abstract this aspect of the testing model so that we can reuse it in testing any Web Service. \n \nIn this paper, as a first step towards automating the testing of Web Services over HTTP, we describe a practical mechanism and model for testing RESTful Web Services without side effects and give an example of how we successfully adapted that mechanism to test two different existing Web Services: Storage Room by Thriventures and Google Tasks by Google. For this task we have used Erlang together with state machine models in the property-based testing tool Quviq QuickCheck, implemented using the statem module.","PeriodicalId":140676,"journal":{"name":"Erlang Workshop","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2013-09-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"18","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Erlang Workshop","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2505305.2505317","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 18

Abstract

Developing APIs as Web Services over HTTP implies adding an extra layer to software, compared to the ones that we would need to develop an API distributed as, for example, a library. This additional layer must be included in testing too, but this implies that the software under test has an additional complexity due both to the need to use an intermediate protocol in tests and to the need to test compliance with the constraints imposed by that protocol: in this case the constraints defined by the REST architectural style. On the other hand, these requirements are common to all the Web Services, and because of that, we should be able to abstract this aspect of the testing model so that we can reuse it in testing any Web Service. In this paper, as a first step towards automating the testing of Web Services over HTTP, we describe a practical mechanism and model for testing RESTful Web Services without side effects and give an example of how we successfully adapted that mechanism to test two different existing Web Services: Storage Room by Thriventures and Google Tasks by Google. For this task we have used Erlang together with state machine models in the property-based testing tool Quviq QuickCheck, implemented using the statem module.
面向RESTful web服务的基于属性的测试
将API开发为基于HTTP的Web服务意味着在软件中添加一个额外的层,而不是像库那样需要开发分布式API。这个额外的层也必须包含在测试中,但这意味着被测软件具有额外的复杂性,因为需要在测试中使用中间协议,并且需要测试该协议所施加的约束的遵从性:在这种情况下,由REST体系结构风格定义的约束。另一方面,这些需求对于所有Web服务都是通用的,因此,我们应该能够抽象测试模型的这一方面,以便我们可以在测试任何Web服务时重用它。在本文中,作为在HTTP上自动化测试Web服务的第一步,我们描述了一种实用的机制和模型,用于测试无副作用的RESTful Web服务,并给出了一个例子,说明我们如何成功地采用该机制来测试两个不同的现有Web服务:Thriventures的Storage Room和Google的Google Tasks。对于这个任务,我们在基于属性的测试工具Quviq QuickCheck中使用了Erlang和状态机模型,使用了statem模块来实现。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术官方微信