java java中有哪些可用的单元测试框架?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4055957/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What are the unit testing frameworks available in java?
提问by Sarit
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)什么是最流行的?你能解释一下每个的优缺点吗?
回答by Jon
JUnitand TestNGare the main unit test frameworks.
JUnit和TestNG是主要的单元测试框架。
Comparison can be found here - http://www.mkyong.com/unittest/junit-4-vs-testng-comparison
可以在这里找到比较 - 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.
我在我工作过的大多数地方都使用过 JUnit,它似乎是标准,但在 TestNG 中有一些不错的东西。
I've used the following in combination with JUnit to facilitate testing:
我将以下内容与 JUnit 结合使用以促进测试:
- Mockitofor mocking objects - http://code.google.com/p/mockito/
- Hamcrestassertions for more readable assertions - http://code.google.com/p/hamcrest/
- Twipfor parameterized testing, the JUnit stuff isn't the greatest, in fact TestNG does this better as well - http://twip.sourceforge.net/
- Mockito用于模拟对象 - http://code.google.com/p/mockito/
- Hamcrest断言以获得更可读的断言 - http://code.google.com/p/hamcrest/
- Twip用于参数化测试,JUnit 的东西并不是最好的,事实上 TestNG 也做得更好 - http://twip.sourceforge.net/
回答by Bozho
回答by Michael Borgwardt
回答by Shahid Siddique
Heres is a list
这是一个列表
- JUnit
- Cactus
- StrutsTestCase
- JFCUnit 10 javascript framework to download
- TestNG
- jMock
- Grinder
- Jetif
- Unitils
- p-unit
- XMLUnit
- Ejb3Unit
- FEST-Swing
- Ripplet
- Feed4JUnit
- Jubula functional testing tools
- JsTestDriver
- Citrus Testframework 19.JBehave
- JCrawler – load testing framework
- JUnit
- 仙人掌
- Struts 测试用例
- JFCUnit 10 javascript框架下载
- 测试NG
- 模拟
- 磨床
- 捷夫
- 单位
- p单位
- XML单元
- Ejb3单元
- FEST-Swing
- 波纹
- Feed4JUnit
- Jubula 功能测试工具
- 测试驱动程序
- 柑橘测试框架 19.JBehave
- JCrawler – 负载测试框架
List Source
列出来源
回答by trix
You can find good comparison between JUnit and TestNG here:
您可以在此处找到 JUnit 和 TestNG 之间的良好比较:
http://hi.baidu.com/auraro816/blog/item/efe0574d03db6df4d72afc9f.html
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
如果您有时间收听播客,请尝试使用 Basement 编码器 - 第 21 集 – 采访 testNG 的 Cedric Beust 创建者
回答by java_mouse
Apart from all the listing above, You can include selenium as well. This is widely used in industry for Java UI testing.
除了上面列出的所有内容,您还可以包含硒。这在业界广泛用于 Java UI 测试。