用户名: 密码: 验证码:
XML技术在软件测试自动化中的应用
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
自动化测试能够提高测试过程的系统性和计划性,提高测试效率,减少测试成本,自动化测试中最重要的环节是自动生成测试用例。本文将XML技术应用于软件自动化测试,设计了一种基于XML描述的测试用例生成方法,该方法根据用户的程序结构,将从待测程序中提取的逻辑信息存放在XML文档中,并根据生成的XML文档生成测试用例,将XML文档作为执行测试的一个中间信息表示环节。自动化测试中将XML文档作为承上启下的中间信息表示环节的好处是:使用XML可以动态的加载和初始化构件,并且易于扩展;XML文档的格式非常规范,那么就可以开发出各种转换程序,灵活地将测试脚本转换成各种我们所需要的文档;生成的XML文档很容易利用第三方的工具来察看、编辑;XML的与语言及平台无关的特性,使测试用例与语言及平台无关,从而支持测试用例在不同语言环境及平台下的复用,使得课题所开发的自动化测试工具易于扩展成支持多语言和多平台,提高了软件的可扩展性。
     本文的主要工作有:提出一个基于XML的自动化测试系统运行框架:根据用户的程序结构,从待测程序中提取出逻辑信息,并将逻辑信息存放在XML文档中,并根据生成的XML文档生成测试用例;提出根据待测程序的逻辑分支生成XML文档的算法并实现;提出根据生成的XML文档,按照白盒测试的判定条件覆盖、路径覆盖的覆盖方法,生成测试用例的算法并实现;并设计和实现了一个应用该框架的小型自动化白盒测试工具,该工具可以实现测试信息的自动收集、测试用例的自动生成、测试用例的自动执行和生成测试报告等功能。
Automated test makes the test process more systematic and calculated, raise the efficiency of the test process, and reduces the cost of the test process. The most important aspects of the automated test is the automatically generated of test case. This thesis applies the technique of XML to software test, designs an automatically test case generation method based on XML, The method stores the logic of program to be tested into XML documents, and generates the test cases based on the XML documents, makes the XML documents as a link between the information of the program to be test and the test cases. The benefits of making XML documents as a connecting link between the program to be test and the test cases in automated test process is: It is easy to load , expand and initialize components based on XML; XML documents is very canonical, so it is easy to develop the conversion processes to convert the test scripts into a variety of documents needed; The XML characteristics of the independent of the language and the platform makes the test cases to be independent of the language and the platform, makes the expansion of the testing tool of this thesis to multi-language and multi-platform easily, improves the expansibility of the testing tool of this thesis.
     This paper mainly covers three approaches as following:
     Proposed a XML-based automated testing system operational framework: which uses the XML documents stores the logic of the software to be tested, and generate test cases automatically basing on the XML documents, make the XML documents as an inter medium of the software test, improved the flexibility and scalability of the automated testing system .
     Proposed an algorithm of generate XML documents according to the logic branches of the software to be tested and consummates the algorithm.
     Proposed an algorithm of generate test cases according to the six methods of the white color box test: statements coverage, determine coverage, condition coverage, determine condition coverage, conditions combination coverage, path coverage bases on the XML documents.
     Designed and implemented the automated testing tool system, which tests a complex software product thoroughly with minimum human interaction. It can collect the information of the software product under test automatically, generate test cases automatically, execute the test cases automatically and generate test result report automatically.
引文
[1]陈James A.Whittaker著。实用软件测试指南.马良荔,俞立军译.北京:电子工业出版社,2003年1月
    [2]John D.McGregor David A.sykes著.面向对象的软件测试.杨文宏,李新辉,杨洁译.北京:机械工业出版社,2002年8月
    [3]Ron Patton著.软件测试.周予滨.姚静译.北京:机械工业出版社,2002年3月
    [4]张克东,庄燕滨著.软件工程与软件测试自动化教程.北京:电子工业出版社,2002年2月
    [5]Fewster M.Graham D著.舒智勇,包晓露,焦跃等译.软件测试自动化技术与实例详解.北京:电子工业出版社.2000
    [6]毛发尧著.Windows程序软件测试驱动程序设计.北京:清华大学出版社.1999
    [7]BoxD.SkonnardA.LamJ著.卓栋涛译.XML本质论.北京:中国电力出版社,2003
    [8]郑人杰著.实用软件工程.北京:清华大学出版社,1997
    [9]Bogdan Korel著.Automated Software Test Data Generation.lEEE Trans.Software Eng,no:16,1990:870-879
    [10]奚红宇等著.Ada软件测试用例生成工具.软件学报,8(4),1997:297-302.
    [11]王济成著.软件测试及测试用例设计方法.战术导弹技术,2001:68-71.
    [12]钱红兵著.测试数据的自动生成.计算机工程,1996:10-13
    [13]Mark Fewster Dorthy Grahmaz著.舒智勇等译.软件测试自动化技术与实例详解.电子工业出版社,2000.
    [14]刘胜著.软件测试及其自动化.信息技术.no:4,2001:39-40.
    [15]T.F.Keefe.D.Volovik.W.T.Tsai著.Automated Test Case Generation for Programs Specified by Relational Algebra Queries.IEEE Trans.Software Eng.22(2),1990:316-324.
    [16]荚伟,高仲仪著.基于遗传算法的软件结构测试数据生成技术研究.北京航空航天大学学报,22(1),1997:36-40.
    [17]李健,金茂忠著。对象状念测试.北京航空航天大学学报,23(1),1997:98-104。
    [18]J.Ferrante K.Ottenstein,Warren著.The Program Dependence graph and its use in optimization.ACM Trans.Program.Lang.Syst.19(3).1987:319-349.
    [19]王志言等著.区间算术在软件测试中的应用.软件学报,9(6).1998:438-443.
    [20]单锦辉,王戟,马晓冬,齐治昌著.面向路径的测试数据自动生成工具及其图形界面设计.计算机工程与应用,no:6>2002:74-77.
    [21]B.Beizer著.Software Testing Techniques.Van Nostrand Reinhold.1990.
    [22]J.Bergeretti,B.Carre.著.Information-flow analysis of while-programs.ACM Trans.Program.Lang.Syst.,7(1)} 1985:37-61.
    [23]K.Change W.Carlisle,J.CrossD.Brown著.Aheuristic approach for test case generation.In Proceedings of the 1991 ACM Computer Science Conference 1991:174-180.
    [24]许向阳著.遗传算法与结构自动测试计算机工程与应用,no:4,1998:34-36.
    [25]汪浩,谢军凯,高仲仪著.遗传算法及其在软件测试数据生成中的应用研究.计算机工程与应用,no:12,2001:64-68.
    [26]张涌,钱乐秋,王渊峰著。基于确定性有限状态机的测试输入序列选取.计算机研究与发展,no:9,2002:1144-1150.
    [27]叶仁召,李玉墙,郑玉珍著.基于UML规格说明测试用例生成工具.计算机工程,no:3,2001:157-159.
    [28]王志言,刘椿年著.一种路径覆盖的自动生成算法——剪枝法.计算机研究与发展,35(2),1998:169-172.
    [29]林振,吴定一著.基于结构化功能规格说明的测试方法和工具.软件学报,6(6),1995:366-371..
    [30]单锦辉,王戟,齐治昌,马晓东,单黎君著.面向路径的测试数据自动生成工具的设计与实现.计算机工程与科学,24(1),2002:103-107.
    [31]张立强,宫云战著.软件测试中的路径划分技术.装甲兵工程学院学报,16(3).2002:78-82.
    [32]张克东,庄燕滨著.软件工程与软件测试自动化教程.电子工业出版社,2002.
    [33]荚伟,谢军,奚红宁,高仲仪著.遗传算法在软件测试数据生成中的应用.北京航空航天大学学报,24(8),1998:434-437.
    [34]兰毓华,毛法尧,曹化工著.基于Z规格说明的软件测试用例自动生成.计算机学报,22(9),1999:963-969.
    [35]伦立军著.基于程序图的路径测试.小型微型计算系统,19(7).1998:74-77.
    [36]J.Edvardsson著.A survey on automatic test data generation.In Proceedings of the Second Conference on Computer Science and Engineering in Linkoping,no:10,1999:21-28.
    [37]刘海燕,宫云战,杨朝红著.数据流分析.装甲兵工程学院学报,14(9).2000.
    [38]朱鸿,金陵紫著.软件测试和质量保障技术.北京:科学出版社,1997.
    [39]惠特克JA著.马良荔,俞立军译.实用软件测试指南.北京:电子工业出版社,2003.
    [40]Edward Kit著.李新华,陈丽容等译软件测试过程改进,北京:机械工业出版社,2003.
    [41]古乐,史林九著.软件测试技术概论.北京:清华大学出版社,2004.
    [42]Mark Fewster,Dorothy Graham著.舒晓露等译.软件测试自动化技术与实例详解.北京电子工业出版社.2000.
    [43]GordonSchulmeyer等著.李怀璋,武占春等译.软件质量保证.北京:机械工业出版社,2003.
    [44]李必信,梁佳,张勇翔等著.一个基于CHG分析的面向对象程序框架,软件学报,(5),2000.
    [45]邢大红著.面向对象设计中软件度A学的理论和方法,计算机科学,25(1),1998.
    [46]英伟,谢军,奚红宇等著.遗传算法在软件测试数据生成中的应用.北京航空航天大学学报,24(4),1998.
    [47]胡伯蒂著.马博,赵云龙译.软件质量和软件测试北京:清华大学出版社,2003.
    [48]张克东,庄燕滨著.软件工程与软件测试自动化教程.北京:电子工业出版社,2002.
    [49]WilliamE.Perry著.兰雨晴,高静等译.软件测试的有效方法.北京:机械工业出版社,中信出版社,2004.
    [50]JohnD.McGregor,DavidA.Sykes著.杨文宏等译.面向对象的软件测试北京:机械工业出版社,中信出版社,2002.
    [51]CemKaner,JackFalk等著.王峰等译.计算机软件测试.北京:机械工业出版社,2009.
    [52]Paul C.Jorgensen著.软件测试.机械工业出版利.2003。
    [53]S.Balan著.A Composite Model for Software Quality Assurance.Artech House.2003.
    [54]Rick Termant著.Creating Five-Star Test Metrics On a One-Star Budget.Artech House.2003.
    [55]Beizer Boris著.Software Testing Techniques.Reinhold Company.1983.
    [56]王志言,刘椿年著。区间算术在软件测试中的应用.软件学报,1998-43 8443
    [57]王华忠,宋雨著.划分测试与随机测试的比较.华北电力大学学报,2002-4144.
    [58]奚红宇,徐红,高仲仪著.Ada软件测试用例生成上具.软件学报,1997-297-302。
    [59]杨建军,陈卫东,叶澄清等著.面向上下文无关语言的测试上具的设计和实现.计算机研究与发展,2000,37(11):1375.
    [60]曹化上,刘澎,秦友淑著.一种用于软件测试的程序结构划分方法.小型微型计算机系统,2002,23(4):492.
    [61]姬莹,罗钧吴,钟联炯著.面向对象软件测试主要问题的探讨.西安工业学院学报,2001,21(1):3137.
    [62]刘金艳,尹治本,蔺娟如著.面向对象软件测试的研究.微机发展,2003,13<6):5356.
    [63]路小娟,张桂琴,顾梅著.软件测试在面向对象技术开发中的应用设计.甘肃科技,2004,20(8):7475.
    [64]宋艳芳,苏哲明,史永辉著.自动化软件测试.应用科技,2001,28(4):2425.
    [65]杨小平,王胜开著.面向对象软件测试探讨.计算机工程与应用,2000,36(1):4446.

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700