陳英+孫忠林



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