计算机科学与探索 ›› 2017, Vol. 11 ›› Issue (11): 1747-1763.DOI: 10.3778/j.issn.1673-9418.1609024

• 系统软件与软件工程 • 上一篇    下一篇

面向需求覆盖的Web服务自动化测试框架

李  吟1+,方建勇1,江  梦2   

  1. 1. 江苏自动化研究所,江苏 连云港 222061
    2. 连云港职业技术学院,江苏 连云港 222061
  • 出版日期:2017-11-01 发布日期:2017-11-10

Requirement Coverage Oriented Automatic Testing Framework for Web Services

LI Yin1+, FANG Jianyong1, JIANG Meng2   

  1. 1. Jiangsu Automation Research Institute, Lianyungang, Jiangsu 222061, China
    2. Lianyungang Technical College, Lianyungang, Jiangsu 222061, China
  • Online:2017-11-01 Published:2017-11-10

摘要: Web服务作为W3C认证的面向服务架构(service-oriented architecture,SOA)的实现方式,对外提供可用于黑盒测试的接口文档,如何有效地自动化生成测试用例成为Web服务自动化测试的首要问题。现有的测试工具对WSDL(Web services description language)的文档结构和数据之间的依赖关系考虑不足,且缺乏有效的测试数据生成方法,进而导致测试效率不高以及生成的测试用例无法覆盖全部的测试需求。为此,提出了Web服务自动化测试的技术框架,并实现了支持此框架的原型工具。该框架基于WSDL文档解析获取覆盖结构特征的SOAP(simple object access protocol)骨架集合,并采用可变力度组合测试模型生成满足元素组合的SOAP封装消息,之后通过有限状态机/接口契约模型获取操作序列测试路径,保证了操作序列测试数据的有效性。案例结果表明了所提框架生成的测试数据能够更好地满足测试需求,达到理想的测试覆盖率,并能够检测出更多的错误,且在用例规模上优于现有的方法。

关键词: Web服务, 面向服务架构, 自动化测试技术框架, 可变力度组合测试, 有限状态机, 接口契约模型

Abstract: Web services are the W3C-endorsed realization of service-oriented architecture (SOA). Since Web services are tested in black-box via their interfaces, how to automatically generate effective test suites has become a key problem in Web services automatic testing. However, the existing tools take insufficient account of WSDL (Web services description language) schema structure and the dependency between data elements, and lack of effective means of test automation, which may lead to high cost and test data can‘’t cover the test requirements. This paper proposes a test case generate framework and implements a tool which supports the above framework. At first, this framework acquires SOAP (simple object access protocol) skeletons which cover structural characteristics based on WSDL, then generates SOAP envelopes based on variable strength combinatorial testing model, finally generates operation sequence test path through the finite state machine/interface contract model. The experimental results show that the proposed framework can enable the test to achieve the desired coverage, while enhancing the fault detection ability and optimality on the size of existing approach.

Key words: Web services, service-oriented architecture, automation test framework, variable strength combinatorial test, finite state machine, interface contract model