A Tool for Automatic Service Interface Testing
-
摘要: 在面向服务的架构中,软件功能通常被封装为服务,并以开放可编程接口的方式提供应用.因此,服务接口的正确性和可靠性对于服务理解、重用和集成至关重要.随着软件即服务的思想被广为认可,互联网上越来越多的软件应用以服务接口方式提供开放式访问.面对众多的服务接口,如何进行高效且有效的测试是一个亟待解决的问题.为此,提出了一种基于模型驱动的自动化测试方法,首先采用接口语义契约模型对被测服务接口建模,然后基于接口模型和测试覆盖率需求为单个服务和组合服务生成测试数据和测试用例.在此基础上,设计并实现了AutoTest自动化测试工具,该工具采用多种算法用于优化测试用例生成,且支持图形化测试计划编排和跨语言测试代码生成.实验结果表明,AutoTest能够有效支持大批量测试用例的设计和生成,根据OED(正交实验设计)算法生成的测试用例与IPO组合算法得到的用例相比,具有更为理想的测试覆盖率.Abstract: In SaaS (software-as-a-service), software functions are encapsulated as independent and self-contained services, and users can access these services through well-defined interface. The correctness and reliability of service interfaces are critical for service understanding, reuse and integration. With the increasing acceptance of SaaS, more and more software expose interfaces for Internet-based open access. API testing for service interfaces is thus getting increasing attentions. To this end, a model-driven automatic testing method is presented to facilitate efficient and effective service interfaces testing. A model called ISC (interface semantic contract) is defined for modeling services with domain knowledge. Following the model-driven approach, tests are generated from ISC at three levels: test data, test cases for individual services and for composite services. Test cases are then translated to target programming languages through a kind of meta-model defined for test cases. An automatic testing tool (AutoTest) has been designed and implemented, which integrates various algorithms to optimize test generation. What’s more, the tool supports design test plan in graphical form and generates test cases in multiple programming languages, for example, C++ or Java. Experimental results demonstrate that AutoTest can support design and generation of large quantities of test cases effectively and efficiently, and test cases generated by OED (orthogonal experimental design) algorithm have more satisfactory test coverage than those by pairwise IPO (in parameter order) algorithm.
-
Keywords:
- service interface /
- model-driven test /
- test cases generation /
- automatic test /
- testing tool
-
-
期刊类型引用(7)
1. 史涯晴,许山山,易明煜,简开宇. 基于协议模型的嵌入式软件接口测试数据生成. 陆军工程大学学报. 2024(05): 57-66 . 百度学术
2. 高冬梅,梅新奎,宿文玲,宋笑兵. 金融分布式接口自动化测试工具设计. 智能计算机与应用. 2023(01): 149-152+157 . 百度学术
3. 耿嘉祺,李鑫丽,祝小兰. 支持用例集并行测试的接口测试平台. 计算机系统应用. 2023(06): 91-98 . 百度学术
4. 雷建胜,苏晓,金明磊. 一种分布式可持续集成自动化测试平台. 计算机与现代化. 2020(04): 14-18 . 百度学术
5. 徐京京,马素霞,王海威. 一种面向多监测终端厂家服务的调用方法. 计算机与数字工程. 2020(04): 895-898 . 百度学术
6. 虞砺琨,左万娟,于倩,陈华南,黄晨. 基于数据模型的接口用例自动生成. 测控技术. 2020(07): 24-29 . 百度学术
7. 刘国庆,汪兴轩. 基于Charles录制会话的HTTP接口自动化测试框架设计与实现. 计算机应用与软件. 2019(06): 7-13 . 百度学术
其他类型引用(11)
计量
- 文章访问数: 1058
- HTML全文浏览量: 7
- PDF下载量: 811
- 被引次数: 18