What is JBehave?

JBehave is a framework for Behaviour-Driven Development (BDD). BDD is an evolution of test-driven development (TDD) and acceptance-test driven design, and is intended to make these practices more accessible and intuitive to newcomers and experts alike. It shifts the vocabulary from being test-based to behaviour-based, and positions itself as a design philosophy.

Features of JBehave include:

  • Pure Java implementation, which plays well with Java-based enterprises.
  • Users can specify and run text-based user stories, which allows "out-in" development.
  • User stories can be specified as classpath resources or external URL-based resources.
  • Annotation-based binding of textual steps to Java methods, with auto-conversion of string arguments to any parameter type (including generic types) via custom parameter converters.
  • Annotation-based configuration and Steps class specifications
  • Dependency Injection support allowing both configuration and Steps instances composed via your favourite container (Guice, PicoContainer, Spring).
  • Extensible story reporting: outputs stories executed in different human-readable file-based formats (HTML, TXT, XML). Fully style-able view.
  • Auto-generation of pending steps so the build is not broken by a missing step, but has option to configure breaking build for pending steps.
  • Pluggable step prioritising strategy. Strategies bundled in core include: by priority field and by Levenshtein Distance.
  • Localisation of user stories, allowing them to be written in any language.
  • IDE integration: stories can be run as JUnit tests or other annotation-based unit test frameworks, providing easy integration with your favourite IDE.
  • Ant integration: allows stories to be run via Ant task
  • Maven integration: allows stories to be run via Maven plugin at given build phase

Want to learn more?

The Getting Started page will get you up and running in no time.