面向WinForm Control的自动化测试框架的设计与实现

上传人:wo7****35 文档编号:87834499 上传时间:2019-04-12 格式:DOC 页数:68 大小:1.25MB
返回 下载 相关 举报
面向WinForm Control的自动化测试框架的设计与实现_第1页
第1页 / 共68页
面向WinForm Control的自动化测试框架的设计与实现_第2页
第2页 / 共68页
面向WinForm Control的自动化测试框架的设计与实现_第3页
第3页 / 共68页
面向WinForm Control的自动化测试框架的设计与实现_第4页
第4页 / 共68页
面向WinForm Control的自动化测试框架的设计与实现_第5页
第5页 / 共68页
亲,该文档总共68页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《面向WinForm Control的自动化测试框架的设计与实现》由会员分享,可在线阅读,更多相关《面向WinForm Control的自动化测试框架的设计与实现(68页珍藏版)》请在金锄头文库上搜索。

1、摘要摘要随着控件技术的不断发展,用户对WinForm Control的需求不断增加,使得WinForm Control逐渐产品化,一批以WinForm Control为产品的公司或者部门的建立更加推动了其快速发展。与此同时,也给WinForm Control的自动化测试提出了新的要求。目前,现有的用于WinForm Control自动化测试的自动化测试框架都是单元测试框架,只能用于测试WinForm Control的基本属性、方法和事件,而其他测试只能手动进行,因此,开发一套面向WinForm Control的自动化测试框架是非常有必要的。本文深入研究了WinForm Control的特点,详

2、细分析了WinForm Control自动化测试的原理及过程,对现有的单元测试框架做了简单的介绍,通过研究,在单元测试框架NUnit的基础上,着重处理鼠标和键盘的交互操作,并将GUI测试思想应用到WinForm Control的自动化测试中,将WinForm Control的各个组成部分抽象成一个ComponentGUI,让测试人员可以方便地定位控件并进行自动化测试,最终实现了面向WinForm Control的自动化测试框架。整个框架在设计上充分考虑了代码的可复用性、可移植性和可维护性。目前,该自动化测试框架已经在日本多家控件公司投入使用,达到实用化水平。关键词:WinForm Contro

3、l 自动化测试 GUI InputAbstractAbstractWith the continuous development of control techniques and the increasing demand for WinForm Control,WinForm Control is gradually commercialized in recent years,and the establishment of a group of corporations or departments taking WinForm Control as their product fur

4、ther promotes its rapid development. Meanwhile, new requirements of automatic testing of WinForm Control have been arisen. At present,existing automatic testing frameworks for WinForm Control are all unit testing frameworks,which can only be used to test the basic attributes,methods and events of Wi

5、nForm Control,that is to say,other tests have to be operated manually. Thus,it is very necessary to develop a automatic testing framework for WinForm Control.In this article,the features of WinForm Control are firstly introduced,then,the principles and procedures of automatic testing for WinForm Con

6、trol are discussed in detail and existing unit testing frameworks are also introduced briefly. Finally,a new automatic testing framework for WinForm Control is introduced. The new framework is mainly based on the following ideas:on the basis of the unit testing framework NUnit,focusing on the handli

7、ng of the interactive operations of keyboard and mouse;and the ideas of GUI based testing are introduced in the automatic testing for WinForm Control:the components of WinForm Control are abstracted to a ComponentGUI,so that the testers can easily locate controls and test them. The proposed framewor

8、k takes into account the reusability,the portability and the maintainability of codes. At present,this automatic testing framework has been put into practical use in many Japanese control corporations.KeyWords: WinForm Control Automatic Testing GUI Input目录目录第一章 绪论11.1 研究背景11.2 国内外现状21.3 课题的意义21.4 论文

9、的工作和结构3第二章 WinForm Control及常用单元测试框架52.1 WinForm Control的定义及分类52.1.1 WinForm Control的定义52.1.2 WinForm Control的分类62.2 常用单元测试框架92.2.1 JUnit测试框架原理92.2.2 CppUnit测试框架原理122.2.3 NUnit测试框架原理132.2.4 XU测试框架原理152.3 小结16第三章 WinForm Control自动化测试研究与分析173.1 WinForm Control自动化测试原理分析173.1.1 基本属性、方法和事件的测试173.1.2 鼠标和键盘

10、相关事件的测试203.1.3 GUI测试243.2 WinForm Control自动化测试的流程263.3 WinForm Control自动化测试的优点263.4 小结27第四章 面向WinForm Control的自动化测试框架的设计294.1 GUI测试框架的设计294.2 Input测试框架的设计354.2.1 鼠标输入测试框架的设计354.2.2 键盘输入测试框架的设计384.3 结果比较方法的设计404.4 面向WinForm Control的自动化测试框架的优点414.5 小结42第五章 面向WinForm Control的自动化测试框架的验证455.1 制定测试用例455.2

11、 编写测试脚本465.3 运行测试脚本515.4 生成测试报告535.5 小结54第六章 结束语55致谢57参考文献593第一章 绪论第一章 绪论随着计算机技术的发展,人们对软件产品的质量有了更高的要求,因此软件测试工作在整个软件开发的过程中也越发重要。从繁杂的手工测试到实用性强的自动化测试,从最初只提供简单的捕捉/回放功能的测试工具到功能和灵活性更强的测试脚本工具,自动化测试已经取得了很大的进步2。但随着软件规模的不断扩大,软件类型的不断增多,人们希望自动化测试能够更加高效和简便。自动化测试框架的出现,加速了自动化脚本的生成,提高脚本的可维护性,加速脚本执行效率等,目的是减少实现和维护的成本

12、,使测试人员可以把精力集中在应用程序的测试用例设计上,而不是开发测试。1.1 研究背景2001年后,.NET Framework2.0的诞生,人们将它看作是多年来最重要的新技术。.NET Framework以多种方式对面向组件的开发模式做了强而有力的支持。.NET Framework为开发人员提供了两种控件支持:一种是Web Control,一种是WinForm Control15。其中WinForm Control是目前发展最快,应用最广泛的。.NET Framework使得开发人员可以通过将多个标准WinForm Control组合,而定制出符合用户需求的应用程序。开发人员还可以通过继承某

13、个标准WinForm Control,附加新的功能与业务逻辑满足自己的需要。更高级的开发人员可以直接从.NET Framework提供的Control基类派生出自定义的WinForm Control(Custom Control)20。尽管面向组件的开发模式和.NET Framework的支持,使得WinForm Control的开发人员以及厂商获取了更多的好处,但却给WinForm Control的测试工作带来了很多困难,因为目前市场上并不存在面向WinForm Control的自动化测试框架,因此,对于WinForm Control的测试,除了最基本的属性、方法和事件的测试可以利用目前常用

14、的单元测试框架实现自动化测试以外,其他大部分对于WinForm Control的测试都必须依靠测试人员手动完成。但随着WinForm Control的不断发展,最终用户对WinForm Control的种类、质量、功能以及用户界面的要求也在不断增加,这就推动了市场的壮大,同时促进了一批以WinForm Control为产品的公司或者部门的建立,最终将推动WinForm Control从产品向产业进一步发展,因此,自动化测试WinForm Control也成为一种必然,那么开发一套面向WinForm Control的自动化测试框架是非常有必要的。1.2 国内外现状目前,可用于对WinForm C

15、ontrol的基本属性、方法和事件进行自动化测试的单元测试框架很多,常用的单元测试框架根据开发语言不同,可分为13:1 JUnit:JUnit就是为Java程序开发者实现单元测试提供一种框架,使得Java单元测试更规范有效,并且更有利于测试的集成。此框架是由Alan Ray和Erich Gamma开发的。2 CppUnit:CppUnit是从著名的JUnit框架为C+移植过来的。是由Michael Feathers开发的。3 Microsoft.NET Framework提供的单元测试框架,包括:NUnit、CsUnit、MbUnit和XU。许多.NET开发人员都或多或少有一些使用NUnit的经验,它是.NET的一个最主要的单元测试框架,是由James Newkirk所开发的。虽然NUnit涵盖了.NET应用程序单元测试的大多数必要情景,但MbUnit可以让单元测试更进一步。MbUnit是由Jonathan “Peli” de Halleux首先编写的一个开源单元测试框架。最新推出的单元测试框架为XU,此框架从现有框架中脱颖而出的因素有很多。最重要的一点是,它是由James Newkirk和Brad Wils

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 学术论文 > 毕业论文

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号