陳英+孫忠林
摘 要:為了在軟件產(chǎn)品發(fā)布之前確保軟件質(zhì)量,軟件測(cè)試的重要性越來(lái)越受到人們重視。以專(zhuān)項(xiàng)能力管理系統(tǒng)為基礎(chǔ),闡述了軟件測(cè)試的方法和過(guò)程以及測(cè)試腳本開(kāi)發(fā)過(guò)程中事務(wù)和集合點(diǎn)的插入。按照統(tǒng)一標(biāo)準(zhǔn)測(cè)試Web對(duì)各種請(qǐng)求的響應(yīng)時(shí)間,并結(jié)合LoadRunner性能測(cè)試工具對(duì)性能測(cè)試的兩個(gè)重要指標(biāo),即響應(yīng)時(shí)間和并發(fā)用戶(hù)數(shù)進(jìn)行研究,給出可靠的性能評(píng)價(jià)。使用LoadRunner進(jìn)行測(cè)試分析可快速找到系統(tǒng)瓶頸,并通過(guò)結(jié)果分析采取相應(yīng)的優(yōu)化方案,在保證并發(fā)用戶(hù)數(shù)不變的前提下再次進(jìn)行測(cè)試。在虛擬用戶(hù)數(shù)量相同的情況下,優(yōu)化前比優(yōu)化后的響應(yīng)時(shí)間減少了10%,系統(tǒng)性能得以提升。
關(guān)鍵詞:LoadRunner;軟件測(cè)試;軟件優(yōu)化
DOI:10.11907/rjdk.172322
中圖分類(lèi)號(hào):TP306 文獻(xiàn)標(biāo)識(shí)碼:A 文章編號(hào):1672-7800(2017)009-0026-02
Abstract:The importance of software testing has been paid more and more attention to in order to ensure the quality of the software products before the release of the software, to ensure that the software products meet the performance needs. On the basis of special ability management system, the method and process of software testing and the insertion of transaction and rendezvous during the development of test script are expounded. This paper tests the Web response time of various requests with the unified standard and combined with LoadRunner performance testing tool response time and the number of concurrent users of two important indicators of performance test are studied. The performance evaluation is given reliable. By using the method of LoadRunner test and analysis, the system bottleneck can be found quickly, and the corresponding optimization scheme is adopted through the result analysis. On the premise that the number of users remains unchanged to test again. The response time after optimization is reduced by 10%, so the performance of the system is improved.
Key Words:LoadRunner; software test;software optimization
0 引言
隨著網(wǎng)絡(luò)信息技術(shù)的快速發(fā)展,信息技術(shù)已廣泛滲透到教育管理的整個(gè)過(guò)程,為人們的活動(dòng)提供了諸多便利。為了在軟件產(chǎn)品發(fā)布之前確保軟件質(zhì)量,軟件測(cè)試應(yīng)運(yùn)而生[1-2]。通過(guò)軟件測(cè)試可以提前發(fā)現(xiàn)產(chǎn)品缺陷,并將缺陷風(fēng)險(xiǎn)降到最低。本文重點(diǎn)通過(guò)使用LoadRunner對(duì)專(zhuān)項(xiàng)能力管理系統(tǒng)進(jìn)行測(cè)試,研究并分析軟件測(cè)試的方法、過(guò)程并提出優(yōu)化方案[3-4],可為實(shí)現(xiàn)教學(xué)管理智能化和信息化提供有力的技術(shù)支撐,同時(shí)也可促進(jìn)信息技術(shù)在教育領(lǐng)域的應(yīng)用。
1 軟件測(cè)試方法
(1)白盒測(cè)試。白盒測(cè)試可以看作一個(gè)透明盒子,不僅僅只是考慮外部形態(tài),更多的是考慮盒子內(nèi)部的邏輯結(jié)構(gòu)。白盒測(cè)試又稱(chēng)為結(jié)構(gòu)測(cè)試,有動(dòng)態(tài)測(cè)試和靜態(tài)測(cè)試之分[5]。動(dòng)態(tài)測(cè)試主要是性能和內(nèi)存,以及功能和接口之間的測(cè)試,靜態(tài)測(cè)試主要是對(duì)程序和結(jié)構(gòu)的評(píng)估[6]。
(2)黑盒測(cè)試。黑盒測(cè)試不用關(guān)心黑盒子里的結(jié)構(gòu),僅根據(jù)已知軟件規(guī)格設(shè)計(jì)說(shuō)明的前提下進(jìn)行測(cè)試。主要測(cè)試每個(gè)功能是否滿(mǎn)足客戶(hù)需求,因此黑盒測(cè)試又稱(chēng)為功能測(cè)試。主要測(cè)試方法有等價(jià)類(lèi)劃分和隨機(jī)數(shù)法[7-8]。
2 LoadRunner測(cè)試過(guò)程
2.1 測(cè)試計(jì)劃
測(cè)試之前首先要明確測(cè)試的方法路徑、工具和需測(cè)試的功能。本文使用loadrunner11.0作為性能測(cè)試工具,選擇專(zhuān)項(xiàng)能力管理系統(tǒng)中的學(xué)員登錄系統(tǒng)功能作為測(cè)試用例。
2.2 測(cè)試環(huán)境
專(zhuān)項(xiàng)能力管理系統(tǒng)被測(cè)的程序使用的測(cè)試環(huán)境為:操作系統(tǒng)Windows10,數(shù)據(jù)庫(kù)MySQL與應(yīng)用服務(wù)器tomcat7.0。
2.3 測(cè)試腳本
首先進(jìn)行Create/Edit Scripts測(cè)試腳本的錄制,使用http協(xié)議進(jìn)行錄制,錄制的URL為http://localhost:9580/zxnlglxt/login.jsp,錄制窗口和錄制過(guò)程如圖1、圖2所示。
錄制代碼如下:
vuser_init()
{
web_url("login.jsp ",
"URL=http://localhost:9580/zxnlglxt/login.jsp/",endprint