TTD 测试驱动开发

【TTD测试驱动开发】测试应用有很多方法,例如,黑盒测试、白盒测试、迭代测试等,然而,这些方法都是从宏观上描述测试的 。为了在技术上保障测试的效果,Kent Beck(也是极限编程创始人)提出了在结果上进行限制的测试方法,也就是在编写程序之前,先确定程序中的变量、控件等元素允许的值 。如果在编写程序时,变量、控件中的值与事先确定的值不相符,就说明程序的某处有bug,这种测试方法就是TDD(Test,测试驱动开发) 。TDD和 ES一样,并不是具体的软件或程序库,只是一套测试框架(Junit),可用于对应用程序进行TDD测试 。
SDK提供的测试框架,该测试框架基于Junit 。测试框架不仅可以测试普通的java类(继承),也可以测试的应用程序组建,如()、()、和() 。
Thehas these key :
testarebased on JUnit 。You can use plain JUnit to test a class that doesn't call theAPI, or 's JUnitto test。If you're new to, you can start with - test casesuch asthen go on to use more。TheJUnit- test case。Theseformockandthat help youtheof a。
Testarein testthat areto main, so you don't need to learn a new set of tools orforandtests 。The SDK tools forand tests areinwith ADT, and also in -line form for use with other IDEs 。These tools getfrom theof theunder test and use thistothe build files,file, andfor the test。
The SDK also , an API forwith, andUI/, a -line tool for - UIs by-to a。

TTD  测试驱动开发

文章插图
测试框架结构图
----------------------------------------------- 真正对的那个人永远不会错过- ---------------------------------------------------
测试类书写指导
测试类型
继承的类
获取测试对象的代码
tion
= this.()
= ()
= new (,.class);
();
= ();
普通Java类
= new ();