本文介绍了JBehave和Cucumber之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在某处读到JBehave实际上是Cucumber的Java等价物,而Cucumber基于Ruby。

I have read somewhere that JBehave is actually the Java equivalent of Cucumber, whereas Cucumber is based on Ruby.

有人可以描述它们之间的区别,提供链接?

Can someone describe the differences between them provide links that do?

推荐答案

JBehave和Cucumber是完全不同的框架,虽然意义相同:接受测试。它们基于故事(JBehave)或功能(黄瓜)。特征是从特定项目利益相关者的角度表达的故事集合。在你的测试中,你指的是故事,通常通过正则表达式匹配。

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是一个纯Java框架,而Cucumber基于Ruby。两者都是非常成熟的框架。您可以通过使用来自Java的Cucumber ,但仍然存在语言不匹配,因为它继续要在内部使用Ruby,您需要在运行测试的机器上安装此语言及其基础结构(所谓的gems)。这可能是脆弱的,并且语言不匹配使调试和阻碍测试的性能变得复杂。现在有一个纯Java实现的Cucumber,称为。截至2011年12月,尚未发布,但完全可用(编辑:)。这个新框架非常类似于JBehave,因为它们都有原生的JUnit支持。

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.

以下是Cucumber-JVM和JBehave的比较。

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

相似之处:


  • JUnit支持开箱即用


  • 快速

  • 易于使用

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

/缺少JBehave:

Pros/Cons of JBehave:


  • (编辑:Cucumber-JVM现在支持HTML输出)

  • (edit: Cucumber-JVM now does support HTML output)

如果你是Java项目,我建议JBehave(如果你正在寻找伟大的文档)或Cucumber-JVM(如果功能的支持或故事是重要的)。

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).

我试过两个框架,并为Cucumber-JVM。

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

这篇关于JBehave和Cucumber之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 17:57