关键字驱动测试中基于QTP的测试框架及数据接口的研究
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
软件测试是当前保证软件质量的重要手段,随着软件规模的不断扩大和复杂度日益提高,传统的软件测试技术和方法已经无法满足大型软件的测试需求,越来越多的公司不断加大自动化测试在项目测试中的比例。自动化测试是当前降低测试成本,提高测试效率,提高软件质量的有效手段。
     本文首先介绍课题的背景和意义,综述软件测试的历史与现状,软件自动化测试的概念和当前的发展情况,简要地概述了自动化测试的优势和局限性,接着介绍了当前流行的两种自动化测试框架:数据驱动(Data Driven)的自动化测试框架和关键字驱动(Key Word Driven)的自动化测试框架,关键字驱动的测试框架是数据驱动的测试框架的一种改进类型,它不仅分解了测试脚本和测试数据,还将测试脚本中的操作动作关键字独立出来,存储为一个数据文件用来驱动脚本的执行。
     本文研究的主要内容有:
     (1)基于业界最先进的功能性自动化测试工具Quick Test Professional(QTP),提出了一个结构层次清晰,易于实现的关键字驱动测试框架;
     (2)在该框架的基础上,深入研究测试数据的组织结构,实现了测试代码对三类测试数据读取的接口,这三类数据源分别是Excel表数据,XML树状数据,数据库。这些数据读取接口具有通用性,可以用于所有QTP开发的自动化测试项目中;
     (3)提出了关键字驱动测试脚本批量执行的方法,实现了控制台脚本;
     (4)以产险核心业务系统项目为实施对象,应用了本文提出的测试框架和测试接口,实践经验表明,它增强了自动化测试的可开发性和可维护性,只要基本的测试组件脚本定型后,测试用例的开发就是测试数据的设计,通过“测试集配置文件”决定执行的测试用例,“操作测试数据文件”决定测试用例执行的操作和步骤,测试过程中的测试数据来源于“业务测试数据文件”,实践数据表明,关键字驱动的测试框架相比先前的数据驱动测试框架,提高脚本开发效率40%,降低维护成本50%。
Software testing is one of the most important technologies to ensure software quality nowadays. With the rapid increase of software scale and complexity, the traditional technologies of software testing cannot meet the requirement of large software testing. Companies are putting more effort in automation in the project. Automation testing can effectively reduce test cost, increase test efficiency and improve software quality.
     At first, this paper introduces the background and significance of the research. Software history and current status, automation testing's concept and current trends are reviewed. After overviewing the strength and weakness of automation, two popular automation test frameworks are introduced. One is data driven framework and the other is key word driven framework. The latter is the improved type of the former. It not only breaks down the test script and test data, but also extracts the key operation words from the test script and store these words as an independent data file. Test cases are driven by these key words.
     The researches of the paper mainly focus on:
     (1) Gives out a clear structured, easy implemented key word driven automation test framework based on the most advanced automation testing tool Quick Test Professional (QTP).
     (2) Upon this framework, the structure of test data is analyzed and APIs are developed. There are three kinds of data reading APIs:Excel sheet, XML files and database. These are universal APIs and they can be used in any projects that use QTP as automation testing tool.
     (3) Gives out the method of how to drive all test cases according to the key word file and implements the method in the Control Center.
     (4) This key word driven framework and data access APIs are implemented in General System Base Line (GSBL) project. Practice shows that this framework and APIs improve the speed of test scripts development and reduce maintenance work. When the test component scripts are ready, we only need to design the test data to drive the scripts to run. Test set configuration file will decide which test cases to run; operation key word file will fetch test steps and drive the test scripts; test data during the test process are from the business test file. According to the data matrix, the efficiency of test script development is 40% higher and the maintenance effort is 50% lower compared to the previous data driven test framework.
引文
[1]Myer G. The Art of Software Testing. Wiley,1989
    [2]2007,2008,2009年中国软件测试从业人员调查报告
    [3]蔡军红,软件质量与测试(一),软件世界,2002,6
    [4](美)Carl J.Nagle, Test Automation Frameworks, http://safsdev.sourceforge.net/FRAMESDataDrivenTestAutomationFrameworks.htm
    [5]Edward Kit, Software Testing in the Real World:Improving the Process.1995
    [6]李玮,软件自动化测试混合框架的研究与实现,北京交通大学硕士论文,2006,12
    [7](美)Glenford Myers, The Art of Software Testing, Second Edition, Hoboken, New Jersey, John Wiley & Sons, Inc,1991
    [8]张丽波,基于自动化的软件测试与应用,华南理工大学硕士论文,2004,5
    [9]Bruce A. Posey, Just Enough Software Test Automation.机械工业出版社,2003, 10
    [10]xUnit Wikipedia, http://en.wikipedia.org/wiki/XUnit
    [11]LoadRunner Wikipedia, http://en.wikipedia.org/wiki/LoadRunner
    [12]Quick Test Professional Wikipedia, http://en.wikipedia.org/wiki/QTP
    [13]陆登,自动化测试在大型软件系统的应用与研究,浙江大学硕士论文,2010,10
    [14]陈雷,软件测试实践之缺陷跟踪管理,程序员,2004(12)
    [15]软件测试框架--从入门到精通
    [16]软件自动化测试框架的发展,2008,3,http://tech.it168.com
    [17]HP BTO软件页面,https://h10078.www1.hp.com/cda/hpms/display/main/hpms_content.jsp?zn=bto&cp=1-11-127-24%5E1352 4000 313
    [18]赵宇,基于QTP的软件回归测试自动化框架的开发与应用,2009,2
    [19]eBaoTech产品主页,http://www.ebaotech.com/en/product/product_en.shtml
    [20]eBaoTech General System Brochure,2010
    [21]朱菊,软件自动化测试框架TAF及其应用,2006,4
    [22]史永莉等,软件自动化测试方案的效益分析,广西师范大学,《微计算机信息》2010年第26卷第2-3期