当前位置:主页 > 科技论文 > 软件论文 >

基于TestNG的接口测试框架的设计与实现

发布时间:2018-10-12 07:55
【摘要】:近年来,随着移动应用软件数目逐渐庞大以及软件构架的日益复杂化,软件测试在确保软件质量方面发挥着重要作用。接口测试作为测试系统组件间接口的一种测试,具有成本小效率高等特点,在基于接口的软件开发过程中发挥着越来越重要的作用。在此背景下,本文设计开发了一款针对C/S架构的基于TestNG的接口测试框架。论文首先介绍了自动化测试和接口测试框架的研究背景以及国内外现状,并阐释了本文的研究内容以及论文整体结构。接着,分析了框架的目标需求和功能需求,并对框架架构进行整体设计,将测试框架划分为四个模块:安全验证模块、数据驱动模块、HTTP协议模块、报告管理模块。然后,采用STS(eclipse)开发工具、TestNG测试框架、Maven构建工具等搭建系统开发平台和环境,详细阐释了各模块的实现过程。其中,安全验证模块采用Token验证机制、MD5散列算法、AES加/解密算法实现;数据驱动模块采用数据驱动的思想设计并实现,支持的数据文件格式包括@DataProvider格式、CSV格式和EXCEL格式;HTTP协议模块采用httpclient工具封装了 HTTP协议的常用请求方法AppRequest和响应方法Response;报告管理模块结合Log4j实现了测试用例的日志存储,同时,融合了 Jenkins持续集成平台将测试报告发送给测试人员。最后,介绍了测试框架的运行环境和功能测试,并以网易考拉移动端中的商品加入购物车接口为例,展示了本文测试框架的应用。网易考拉项目中大量接口用例的运行结果表明,该框架在一定程度上实现了接口测试的自动化,达到了预期效果,提高了测试效率。
[Abstract]:In recent years, with the increasing number of mobile applications and the complexity of software architecture, software testing plays an important role in ensuring software quality. As a test of the interface between components of the test system, interface testing has the characteristics of low cost and high efficiency. It plays an increasingly important role in the software development process based on interface. Under this background, this paper designs and develops an interface testing framework based on TestNG for C / S architecture. Firstly, this paper introduces the research background of automation test and interface testing framework and the present situation at home and abroad, and explains the research content and the whole structure of this paper. Then, the target and function requirements of the framework are analyzed, and the framework is designed as a whole. The test framework is divided into four modules: security verification module, data-driven module, HTTP protocol module and report management module. Then, the system development platform and environment are built with STS (eclipse) development tools, TestNG test framework and Maven construction tools, and the implementation process of each module is explained in detail. Among them, the security verification module uses Token verification mechanism, MD5 hash algorithm, AES encryption / decryption algorithm, and the data-driven module is designed and implemented with the idea of data-driven. The supported data file formats include @ DataProvider format, CSV format and EXCEL format. The HTTP protocol module encapsulates the common request method AppRequest of HTTP protocol and the response method Response; report management module with Log4j to realize the log storage of test cases, at the same time, the HTTP protocol module encapsulates the common request method of HTTP protocol and the response method Response; report management module. Integrated Jenkins continuous integration platform to send test reports to testers. Finally, the running environment and function test of the test framework are introduced, and the application of the test framework is demonstrated by taking the goods in the mobile terminal of NetEase koala as an example to add the shopping cart interface. The running results of a large number of interface cases in NetEase koala project show that the framework realizes the automation of interface testing to a certain extent, achieves the expected effect and improves the test efficiency.
【学位授予单位】:西南交通大学
【学位级别】:硕士
【学位授予年份】:2017
【分类号】:TP311.52

【参考文献】

相关期刊论文 前10条

1 吕茜;;基于WebDriver和TestNG的网页自动化测试方法[J];软件;2016年12期

2 邓璐娟;李金萌;董东晓;;自动化测试框架技术及应用[J];计算机测量与控制;2016年09期

3 张慧琳;李威;佟秋利;刘玉江;;基于Selenium和TestNG的集成自动化测试平台设计[J];实验技术与管理;2015年09期

4 赵慧娟;李中科;;基于XML数据驱动的TestNG测试研究[J];电子技术与软件工程;2015年15期

5 李真辉;陈闻宇;徐彦之;;基于CI的Web自动化测试平台设计[J];科技导报;2015年09期

6 高s,

本文编号:2265363


资料下载
论文发表

本文链接:https://www.wllwen.com/kejilunwen/ruanjiangongchenglunwen/2265363.html


Copyright(c)文论论文网All Rights Reserved | 网站地图 |

版权申明:资料由用户82ee1***提供,本站仅收录摘要或目录,作者需要删除请E-mail邮箱bigeng88@qq.com