gr8vyguy@Blogjava

JUnit Best Practices

Do not use the test-case constructor to set up a test case, use setUp().

Don't assume the order in which tests within a test case run.

Avoid writing test cases with side effects.

Call a superclass's setUp() and tearDown() methods when subclassing

Do not load data from hard-coded locations on a filesystem

Keep tests in the same location as the source code

Name tests properly

Ensure that tests are time-independent

Consider locale when writing tests

Utilize JUnit's assert/fail methods and exception handling for clean test code

Document tests in javadoc

Avoid visual inspection

Keep tests small and fast

Use the reflection-driven JUnit API

Build a test case for the entire system

Test thread safety

posted on 2007-04-24 11:07 gr8vyguy 阅读(459) 评论(0)  编辑  收藏 所属分类: Java


只有注册用户登录后才能发表评论。


网站导航:
 
<2007年4月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

导航

统计

公告

  • 转载请注明出处.
  • msn: gr8vyguy at live.com
  • 常用链接

    留言簿(9)

    随笔分类(68)

    随笔档案(80)

    文章分类(1)

    My Open Source Projects

    搜索

    积分与排名

    最新评论