JBehave and Cucumber的区别

JBehave and Cucumber are completely different frameworks, although meant for the same purpose: acceptance tests. They are based around stories (JBehave) or features (Cucumber). A feature is a collection of stories, expressed from the point of view of a specific project stakeholder. In your tests, you are referring to the stories, typically via regular expression matching.

JBehave is a pure Java framework whereas Cucumber is based on Ruby. Both are very mature frameworks. You can use Cucumber from Java via the Cuke4Duke Maven plugin from Maven, but there is still a language mismatch as it continues to use Ruby internally and you will need to install this language and its infrastructure (so-called 'gems') on the machine that runs your tests. This can be brittle and the language mismatch complicates both debugging and impedes performance of your tests. There is now a pure Java implementation of Cucumber which is called Cucumber-JVM. As of December 2011, it's not released yet, but perfectly usable (edit: version 1.0.0 was released on March 27th, 2012). This new framework is very similar to JBehave as both have native JUnit support.

The following is a comparison of Cucumber-JVM and JBehave.

Similarities:

  • JUnit support out of the box
  • Pure Java
  • Fast
  • Easy to use

Pros/Cons of JBehave:

  • Pro Very good documentation
  • Pro Pretty good HTML formatting of test results
  • Con Only supports stories, not features

Pros/Cons of Cucumber-JVM:

  • Pro Supports features
  • Con Doesn't support parallel JUnit tests. Will however work with parallel Maven 3 builds.
  • Con Lacking documentation
  • Con No pretty HTML formatting of test results, other than JUnit's own formatting (edit: Cucumber-JVM now does support HTML output)

If you are on a Java project, I would recommend either JBehave (if you are looking for great documentation) or Cucumber-JVM (if the support of features instead or stories is important to you).

I tried both frameworks and went for for Cucumber-JVM.

 

https://stackoverflow.com/questions/7954755/what-are-the-differences-between-jbehave-and-cucumber

转载于:https://www.cnblogs.com/maoya/p/10073710.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值