用p-unit作为你的unit test和performance test工具!
1. 我的程序多线程下正确性如何?性能如何?
2. 虽然java有垃圾收集机制,但是两个不同的java程序员实现相同功能的java程序可能使用的内存大不同。
这两点,很难通过JUnit来解决保证。p-unit很好的解决了这两个问题:
1. 同一个测试案例,可以单线程运行,也可以多线程运行。和JUnit不同,p-unit的思想是测试案例就是测试案例,不牵涉运行逻辑,所以同一个测试案例,可以被不同的运行器运行。p-unit测试案例无需实现任何接口,所以当然兼容JUnit Test案例,包括setUp/tearDown函数。
2. 每个测试函数,p-unit给出了运行时间和内存消耗情况,这使得跑单元测试的同时,也做了时间/内存的性能测试,而无需到出现性能瓶颈时使用昂贵的profiler工具来查找问题。
另外,p-unit尤其侧重性能的测试,它支持同一个测试案例,在不同参数下的运行。相信有性能测试经验的程序员都知道,同一个测试场景,往往要测试3-4个数量级的不同数据,看起性能是线性还是几何增长。这对性能评估非常重要。
测试结果方面,p-unit非常灵活,默认的形势有控制台输出,文件输出,图片和pdf报表。当已正确性测试为主的时候,可以选择控制台输出,当以性能测试为主的话,强烈建议图片和pdf输出,非常直观的看出每个测试案例所消耗的时间和内存情况。
p-unit甚至支持不同虚拟机之间的性能比较,其结果反映到同一张图上,对比非常明显。随着java的开源,现在虚拟机的选择也越来越多, SUN, BEA, IBM, Apache Harmony, Kaffe 哪一个虚拟机最适合你的程序,p-unit非常容易告诉你答案。
p-unit官方主页: http://p-unit.sourceforge.net/
p-unit的相关文章:
http://blog.csdn.net/zhanghuangzhu/
http://zhanghuangzhu.blogspot.com/search/label/p-unit
欢迎使用p-unit,大家一起来讨论!
相关推荐
ERTEC200P-2数据手册
ERTEC200P-2的数据手册。ERTEC200P-2是SIEMENS在PROFINET最新版协议芯片。
GPON上行家庭网关OMCI管理相关说明.pdf
GPON上行家庭网关OMCI管理相关说明.pdf
软件测试专业术语对照表
此文档为软件测试专业术语表,给软件测试人员带来很大方便,按字母分类排序,方便查看,而且文档内容全面。
BobBuilder_app
Twitter Digg Facebook Del.icio.us Reddit Stumbleupon Newsvine Technorati Mr. Wong Yahoo! Google Windows Live Send as Email Add to your CodeProject bookmarks Discuss this article 85 Print Article Database » Database » Other databasesLicence CPOL First Posted 19 Jan 2012 Views 24,219 Downloads 992 Bookmarked 74 times RaptorDB - The Key Value Store V2 By Mehdi Gholam | 8 Mar 2012 | Unedited contribution C#.NETDBABeginnerIntermediateAdvanceddatabase Even faster Key/Value store nosql embedded database engine utilizing the new MGIndex data structure with MurMur2 Hashing and WAH Bitmap indexes for duplicates. See Also More like this More by this author Article Browse Code Stats Revisions (8) Alternatives 4.95 (56 votes) 1 2 3 4 5 4.95/5 - 56 votes μ 4.95, σa 1.05 [?] Is your email address OK? You are signed up for our newsletters but your email address is either unconfirmed, or has not been reconfirmed in a long time. Please click here to have a confirmation email sent so we can confirm your email address and start sending you newsletters again. Alternatively, you can update your subscriptions. Add your own alternative version Introduction What is RaptorDB? Features Why another data structure? The problem with a b+tree Requirements of a good index structure The MGIndex Page Splits Interesting side effects of MGIndex The road not taken / the road taken and doubled back! Performance Tests Comparing B+tree and MGIndex Really big data sets! Index parameter tuning Performance Tests - v2.3 Using the Code Differences to v1 Using RaptorDBString and RaptorDBGuid Global parameters RaptorDB interface Non-clean shutdowns Removing Keys Unit tests File Formats File Format : *.mgdat File Format : *.mgbmp File Format : *.mgidx File Format : *.mgbmr , *.mgrec History Download RaptorDB_v2.0.zip - 38.7 KB Download RaptorDB_v2.1.zip - 39 KB Download RaptorDB_v2.2.zip - 39 KB Download RaptorDB_v2.3.zip - 39.6 KB D
the hacker guide to python
the hacker guide to python


Java SE
