开发者

What are the unit testing frameworks available in java? [closed]

开发者 https://www.devze.com 2023-01-22 21:06 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_如何学JAVA

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 8 years ago.

Improve this question

What are the technologies out there? (I only know of JUnit) What is the most popular? Can you please explain the pros/cons of each?


JUnit and TestNG are the main unit test frameworks.

Comparison can be found here - http://www.mkyong.com/unittest/junit-4-vs-testng-comparison

I've used JUnit in most places I've worked, it seems to be the standard, but there are some nice things in TestNG.

I've used the following in combination with JUnit to facilitate testing:

  • Mockito for mocking objects - http://code.google.com/p/mockito/
  • Hamcrest assertions for more readable assertions - http://code.google.com/p/hamcrest/
  • Twip for parameterized testing, the JUnit stuff isn't the greatest, in fact TestNG does this better as well - http://twip.sourceforge.net/


JUnit and TestNG are the most popular. JUnit being the de-facto standard, and TestNG providing some extra features.


There are a lot of "add-on" framework for specific kinds of testing, typically these depend on JUnit. Examples:

  • DBUnit - for testing code that accesses a database
  • JFCUnit - for testing Swing apps
  • HTMLUnit - for testing web apps


Heres is a list

  1. JUnit
  2. Cactus
  3. StrutsTestCase
  4. JFCUnit 10 javascript framework to download
  5. TestNG
  6. jMock
  7. Grinder
  8. Jetif
  9. Unitils
  10. p-unit
  11. XMLUnit
  12. Ejb3Unit
  13. FEST-Swing
  14. Ripplet
  15. Feed4JUnit
  16. Jubula functional testing tools
  17. JsTestDriver
  18. Citrus Testframework 19.JBehave
  19. JCrawler – load testing framework

List Source


You can find good comparison between JUnit and TestNG here:

http://hi.baidu.com/auraro816/blog/item/efe0574d03db6df4d72afc9f.html

if you have time to listen podcast try with Basement coders -Episode 21 – Interview with Cedric Beust creator of testNG


Apart from all the listing above, You can include selenium as well. This is widely used in industry for Java UI testing.

0

精彩评论

暂无评论...
验证码 换一张
取 消