陳英+孫忠林
摘 要:為了在軟件產(chǎn)品發(fā)布之前確保軟件質(zhì)量,軟件測試的重要性越來越受到人們重視。以專項能力管理系統(tǒng)為基礎(chǔ),闡述了軟件測試的方法和過程以及測試腳本開發(fā)過程中事務(wù)和集合點的插入。按照統(tǒng)一標(biāo)準(zhǔn)測試Web對各種請求的響應(yīng)時間,并結(jié)合LoadRunner性能測試工具對性能測試的兩個重要指標(biāo),即響應(yīng)時間和并發(fā)用戶數(shù)進行研究,給出可靠的性能評價。使用LoadRunner進行測試分析可快速找到系統(tǒng)瓶頸,并通過結(jié)果分析采取相應(yīng)的優(yōu)化方案,在保證并發(fā)用戶數(shù)不變的前提下再次進行測試。在虛擬用戶數(shù)量相同的情況下,優(yōu)化前比優(yōu)化后的響應(yīng)時間減少了10%,系統(tǒng)性能得以提升。
關(guān)鍵詞:LoadRunner;軟件測試;軟件優(yōu)化
DOI:10.11907/rjdk.172322
中圖分類號:TP306 文獻標(biāo)識碼:A 文章編號: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ù)已廣泛滲透到教育管理的整個過程,為人們的活動提供了諸多便利。為了在軟件產(chǎn)品發(fā)布之前確保軟件質(zhì)量,軟件測試應(yīng)運而生[1-2]。通過軟件測試可以提前發(fā)現(xiàn)產(chǎn)品缺陷,并將缺陷風(fēng)險降到最低。本文重點通過使用LoadRunner對專項能力管理系統(tǒng)進行測試,研究并分析軟件測試的方法、過程并提出優(yōu)化方案[3-4],可為實現(xiàn)教學(xué)管理智能化和信息化提供有力的技術(shù)支撐,同時也可促進信息技術(shù)在教育領(lǐng)域的應(yīng)用。
1 軟件測試方法
(1)白盒測試。白盒測試可以看作一個透明盒子,不僅僅只是考慮外部形態(tài),更多的是考慮盒子內(nèi)部的邏輯結(jié)構(gòu)。白盒測試又稱為結(jié)構(gòu)測試,有動態(tài)測試和靜態(tài)測試之分[5]。動態(tài)測試主要是性能和內(nèi)存,以及功能和接口之間的測試,靜態(tài)測試主要是對程序和結(jié)構(gòu)的評估[6]。
(2)黑盒測試。黑盒測試不用關(guān)心黑盒子里的結(jié)構(gòu),僅根據(jù)已知軟件規(guī)格設(shè)計說明的前提下進行測試。主要測試每個功能是否滿足客戶需求,因此黑盒測試又稱為功能測試。主要測試方法有等價類劃分和隨機數(shù)法[7-8]。
2 LoadRunner測試過程
2.1 測試計劃
測試之前首先要明確測試的方法路徑、工具和需測試的功能。本文使用loadrunner11.0作為性能測試工具,選擇專項能力管理系統(tǒng)中的學(xué)員登錄系統(tǒng)功能作為測試用例。
2.2 測試環(huán)境
專項能力管理系統(tǒng)被測的程序使用的測試環(huán)境為:操作系統(tǒng)Windows10,數(shù)據(jù)庫MySQL與應(yīng)用服務(wù)器tomcat7.0。
2.3 測試腳本
首先進行Create/Edit Scripts測試腳本的錄制,使用http協(xié)議進行錄制,錄制的URL為http://localhost:9580/zxnlglxt/login.jsp,錄制窗口和錄制過程如圖1、圖2所示。
錄制代碼如下:
vuser_init()
{
web_url("login.jsp ",
"URL=http://localhost:9580/zxnlglxt/login.jsp/",endprint