ISSN 1000-1239 CN 11-1777/TP

计算机研究与发展 ›› 2017, Vol. 54 ›› Issue (3): 609-622.doi: 10.7544/issn1000-1239.2017.20151045

• 软件技术 • 上一篇    下一篇

基于接口契约的有状态Web服务用例集生成

李吟   

  1. (江苏自动化研究所 江苏连云港 222061) (leein121999@126.com)
  • 出版日期: 2017-03-01

Test Suite Generating for Stateful Web Services Using Interface Contract

Li Yin   

  1. (Jiangsu Automation Research Institute, Lianyungang, Jiangsu 222061)
  • Online: 2017-03-01

摘要: Web服务具有对外只提供接口文档、技术规范复杂和运行时态瞬时多变等特性,如何有效地自动化生成测试数据仍旧是个难题.目前,针对有状态Web服务操作序列的测试研究较少,现有的方法对服务的行为信息和操作之间的数据依赖关系考虑不足,且缺乏有效的测试自动化手段,进而导致测试代价较高以及生成的测试数据缺乏针对性.对此,提出一种结合有限状态机(EFSM)模型和操作接口契约的测试数据生成方法,该方法根据标准WSDL文档建立操作模型,形式化描述操作之间的交互关系,并对其进行语义标注,基于EFSM模型生成操作序列测试路径,随后采用操作接口契约关系获取测试路径中的测试数据.通过案例表明,这种有状态Web服务的用例生成方法能够高效地生成合理的测试数据,并在错误检测能力以及用例有效性方面优于现有的方法.

关键词: 有状态Web服务, 操作序列, 操作接口契约, 扩展有限状态机, 语义标注

Abstract: As Web services have the characteristics of only providing interface documents, complex technical specifications and run-time transient change, it is still a difficult problem to automatically generate test data effectively. At present, there is less current research on testing operation sequence for stateful Web services. Moreover, the existing approaches take insufficient account of service behavior information and the dependency between operations, and are lack of effective means of test automation, which may lead to high cost and short of specific for the test data. In this paper, a test case generation approach is proposed based on EFSM model operation interface contract. This approach constructs the operation model according to the standard WSDL document to describe the interaction relationship between operations and then add semantic annotation for them. Based on EFSM model, the paper proposes an automated operation sequences generation method and finally obtain the test suite using operation interface contract. The experiment shows that the proposed approach can generate reasonable test suite for stateful Web service efficiently, which can enhance the fault detection ability and improve the efficiency of test cases compared with the existed approaches.

Key words: stateful Web services, operation sequence, operation interface contract, extended finite state machine (EFSM), semantic annotation

中图分类号: