基于TestNG的接口測(cè)試框架的設(shè)計(jì)與實(shí)現(xiàn)
發(fā)布時(shí)間:2018-10-12 07:55
【摘要】:近年來(lái),隨著移動(dòng)應(yīng)用軟件數(shù)目逐漸龐大以及軟件構(gòu)架的日益復(fù)雜化,軟件測(cè)試在確保軟件質(zhì)量方面發(fā)揮著重要作用。接口測(cè)試作為測(cè)試系統(tǒng)組件間接口的一種測(cè)試,具有成本小效率高等特點(diǎn),在基于接口的軟件開(kāi)發(fā)過(guò)程中發(fā)揮著越來(lái)越重要的作用。在此背景下,本文設(shè)計(jì)開(kāi)發(fā)了一款針對(duì)C/S架構(gòu)的基于TestNG的接口測(cè)試框架。論文首先介紹了自動(dòng)化測(cè)試和接口測(cè)試框架的研究背景以及國(guó)內(nèi)外現(xiàn)狀,并闡釋了本文的研究?jī)?nèi)容以及論文整體結(jié)構(gòu)。接著,分析了框架的目標(biāo)需求和功能需求,并對(duì)框架架構(gòu)進(jìn)行整體設(shè)計(jì),將測(cè)試框架劃分為四個(gè)模塊:安全驗(yàn)證模塊、數(shù)據(jù)驅(qū)動(dòng)模塊、HTTP協(xié)議模塊、報(bào)告管理模塊。然后,采用STS(eclipse)開(kāi)發(fā)工具、TestNG測(cè)試框架、Maven構(gòu)建工具等搭建系統(tǒng)開(kāi)發(fā)平臺(tái)和環(huán)境,詳細(xì)闡釋了各模塊的實(shí)現(xiàn)過(guò)程。其中,安全驗(yàn)證模塊采用Token驗(yàn)證機(jī)制、MD5散列算法、AES加/解密算法實(shí)現(xiàn);數(shù)據(jù)驅(qū)動(dòng)模塊采用數(shù)據(jù)驅(qū)動(dòng)的思想設(shè)計(jì)并實(shí)現(xiàn),支持的數(shù)據(jù)文件格式包括@DataProvider格式、CSV格式和EXCEL格式;HTTP協(xié)議模塊采用httpclient工具封裝了 HTTP協(xié)議的常用請(qǐng)求方法AppRequest和響應(yīng)方法Response;報(bào)告管理模塊結(jié)合Log4j實(shí)現(xiàn)了測(cè)試用例的日志存儲(chǔ),同時(shí),融合了 Jenkins持續(xù)集成平臺(tái)將測(cè)試報(bào)告發(fā)送給測(cè)試人員。最后,介紹了測(cè)試框架的運(yùn)行環(huán)境和功能測(cè)試,并以網(wǎng)易考拉移動(dòng)端中的商品加入購(gòu)物車(chē)接口為例,展示了本文測(cè)試框架的應(yīng)用。網(wǎng)易考拉項(xiàng)目中大量接口用例的運(yùn)行結(jié)果表明,該框架在一定程度上實(shí)現(xiàn)了接口測(cè)試的自動(dòng)化,達(dá)到了預(yù)期效果,提高了測(cè)試效率。
[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.
【學(xué)位授予單位】:西南交通大學(xué)
【學(xué)位級(jí)別】:碩士
【學(xué)位授予年份】:2017
【分類(lèi)號(hào)】:TP311.52
[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.
【學(xué)位授予單位】:西南交通大學(xué)
【學(xué)位級(jí)別】:碩士
【學(xué)位授予年份】:2017
【分類(lèi)號(hào)】:TP311.52
【參考文獻(xiàn)】
相關(guān)期刊論文 前10條
1 呂茜;;基于WebDriver和TestNG的網(wǎng)頁(yè)自動(dòng)化測(cè)試方法[J];軟件;2016年12期
2 鄧璐娟;李金萌;董東曉;;自動(dòng)化測(cè)試框架技術(shù)及應(yīng)用[J];計(jì)算機(jī)測(cè)量與控制;2016年09期
3 張慧琳;李威;佟秋利;劉玉江;;基于Selenium和TestNG的集成自動(dòng)化測(cè)試平臺(tái)設(shè)計(jì)[J];實(shí)驗(yàn)技術(shù)與管理;2015年09期
4 趙慧娟;李中科;;基于XML數(shù)據(jù)驅(qū)動(dòng)的TestNG測(cè)試研究[J];電子技術(shù)與軟件工程;2015年15期
5 李真輝;陳聞?dòng)?徐彥之;;基于CI的Web自動(dòng)化測(cè)試平臺(tái)設(shè)計(jì)[J];科技導(dǎo)報(bào);2015年09期
6 高s,
本文編號(hào):2265363
本文鏈接:http://sikaile.net/kejilunwen/ruanjiangongchenglunwen/2265363.html
最近更新
教材專(zhuān)著