中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 程序开发 > 软件工程 > 综合文章
Summary in Reading of JUnit in Action(1)
作者:未知 时间:2005-09-13 23:33 出处:Blog.ChinaUnix.net 责编:chinaitpower
              摘要:Summary in Reading of JUnit in Action(1)

Digest, Summary and Feelings after reading the book JUnit in action.

Part One: JUnit distilled

Chapter One: JUnit jumpstart

This chapter covers—The summary written by author
_ Writing simple tests by hand
_ Installing JUnit and running tests
_ Writing better tests with Junit

1. All code is tested, and must be tested.—tested   P29
2. Play-testing code is one thing; running automated tests is another.—another thing  P29
3. Junit is written by Erich Gamma and KentBeck, which is oneof the test framwork of xUnit focused on Java Language, and free for use even in economy condition—free  p29
4. The term “test unit” is discribed in Junit as: a single unit of work on testing called “programming testing” which is different from others.—defference  p30
5. A unit of work is a task that is not directly dependent on the completion of any other task.—independence  p31
6. Any program feature without an automated test simply doesn’t exist.—automated  p32
7. writing a simple test program for the method—simple test  p33

8. Confirm your expected output with your input—expected  p31 and p33
9. Three points of framework which the Test Framework required:
_ Each unit test must run independently of all other unit tests.
_ Errors must be detected and reported test by test.
_ It must be easy to define which unit tests will run.—require  p35
10. Junit can be run in graphic or textual condition.
11. Steps of using Junit to test your case when coding:
   _ extends the test class from the standard JUnit junit.framework.TestCase
   _ the method which want to test named as testXXX() recommendly
   _ make assertion expression whatever you want
   _ test it
    But you should follow these steps as you are preparing programming the test and thinking how to do it.
   _ think what you want the test to do
   _ making assertion
   _ fillfull the test with the steps above to let the test case run.
12. Junit coding tip: assertEquals(number, number, number_ranges)
number which means the int, double, float type date, with the number_ranges argument you can set the distance between these two things.
13. The feathurs of Junit: help us write useful tests; create tests that retain their value over time; lower the cost of writing tests by reusing code.
14. Coding structure extends TestCase of the version pior to Junit 3.8.1 is different, be caution.

关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有