摘要随着控件技术的不断发展,用户对WinFormControl的需求不断增加,使得WinFormControl逐渐产品化,一批以WinFormControl为产品的公司或者部门的建立更加推动了其快速发展。与此同时,也给WinFormControl的自动化测试提出了新的要求。目前,现有的用于WinFormControl自动化测试的自动化测试框架都是单元测试框架,只能用于测试WinFormControl的基本属性、方法和事件,而其他测试只能手动进行,因此,开发一套面向WinFormControl的自动化测试框架是非常有必要的。本文深入研究了WinFormControl的特点,详细分析了WinFormControl自动化测试的原理及过程,对现有的单元测试框架做了简单的介绍,通过研究,在单元测试框架NUnit的基础上,着重处理鼠标和键盘的交互操作,并将GUI测试思想应用到WinFormControl的自动化测试中,将WinFormControl的各个组成部分抽象成一个ComponentGUI,让测试人员可以方便地定位控件并进行自动化测试,最终实现了面向WinFormControl的自动化测试框架。整个框架在设计上充分考虑了代码的可复用性、可移植性和可维护性。目前,该自动化测试框架已经在日本多家控件公司投入使用,达到实用化水平。关键词:WinFormControl自动化测试GUIInputAbstractWiththecontinuousdevelopmentofcontroltechniquesandtheincreasingdemandforWinFormControl,WinFormControlisgraduallycommercializedinrecentyears,andtheestablishmentofagroupofcorporationsordepartmentstakingWinFormControlastheirproductfurtherpromotesitsrapiddevelopment.Meanwhile,newrequirementsofautomatictestingofWinFormControlhavebeenarisen.Atpresent,existingautomatictestingframeworksforWinFormControlareallunittestingframeworks,whichcanonlybeusedtotestthebasicattributes,methodsandeventsofWinFormControl,thatistosay,othertestshavetobeoperatedmanually.Thus,itisverynecessarytodevelopaautomatictestingframeworkforWinFormControl.Inthisarticle,thefeaturesofWinFormControlarefirstlyintroduced,then,theprinciplesandproceduresofautomatictestingforWinFormControlarediscussedindetailandexistingunittestingframeworksarealsointroducedbriefly.Finally,anewautomatictestingframeworkforWinFormControlisintroduced.Thenewframeworkismainlybasedonthefollowingideas:onthebasisoftheunittestingframeworkNUnit,focusingonthehandlingoftheinteractiveoperationsofkeyboardandmouse;andtheideasofGUIbasedtestingareintroducedintheautomatictestingforWinFormControl:thecomponentsofWinFormControlareabstractedtoaComponentGUI,sothatthetesterscaneasilylocatecontrolsandtestthem.Theproposedframeworktakesintoaccountthereusability,theportabilityandthemaintainabilityofcodes.Atpresent,thisautomatictestingframeworkhasbeenputintopracticaluseinmanyJapanesecontrolcorporations.KeyWords:WinFormControlAutomaticTestingGUIInput目录第一章绪论.....................................................................................................................11.1研究背景..................................................................................................................11.2国内外现状..............................................................................................................21.3课题的意义..............................................................................................................21.4论文的工作和结构..................................................................................................3第二章WinFormControl及常用单元测试框架............................................................52.1WinFormControl的定义及分类............................................................................52.1.1W...