Web服务对外只提供接口文档,可利用生成测试用例的信息不够充分,现有方法所生成的用例冗余度高、查错能力有限.文中基于现有Web服务功能和用户协同推荐构建用户需求模型,再使用领域知识和使用场景生成测试用例,并通过实验演示过程,实验结果表明该文方法生成组合Web服务测试用例的有效性.以用户需求驱动组合Web服务测试,既能保证所选服务真正符合用户需求,又可根据用户使用场景来丰富测试需求信息,结合领域知识启发式生成测试用例.
This paper plans to add user requirement information into test case generations for Web services because of the existed situation, i. e. , Web services only provide interface documents for outsides, and the information for test case generation used by testers (except developers) is not enough. At present, the existed test case generation methods have high redundant and low efficiency to find bugs. This paper firstly set up user requirement model by clustering the existed WSDL files of Web services and selecting the exact Web services with other users' collaborative recommendation, and then generated test cases with domain knowledge and usage scenes (basic scene and optional scenes) by the extension of user requirement model and the selection of paths from the entry node to the exit node; finally, the workflow and case study indicated the efficiency of our method was better than the method which generated test cases based on variables' types in the WSDL files. Therefore, testing combinational Web services focused on user requirements can ensure the selected Web services matching user requirements, and the usage scenes also can enrich the information for testing, thus the test cases for Web services can be heuristically and more efficiently generated combining with the domain knowledge.