Home

JBehave

JBehave is an open-source framework for behavior-driven development (BDD) in Java. It enables executable specifications by allowing developers to write user stories in plain text and connect them to Java code that implements the steps described in the stories. Stories are stored in .story files and describe narratives, scenarios, and steps using natural language, typically with Given, When, Then lines.

A JBehave test run comprises three parts: the story files, the Java step definitions, and a runner

JBehave integrates with build and test tools such as Maven or Gradle and can be run from

History note: JBehave is one of the early Java BDD frameworks and was developed as an alternative

or
embedder
that
executes
the
stories.
Step
libraries
contain
methods
annotated
with
@Given,
@When,
and
@Then
(and
related
annotations)
that
match
the
text
in
the
story.
When
a
story
is
executed,
JBehave
maps
each
step
in
the
narrative
to
a
corresponding
Java
method,
executes
it,
and
records
the
outcome.
Reports
are
produced
to
show
which
steps
passed
or
failed,
often
in
HTML
or
text
form.
JUnit
or
TestNG
test
runners.
It
supports
parameterization,
story
metadata,
and
lifecycle
hooks,
enabling
reuse
of
steps
across
stories
and
data-driven
scenarios.
It
emphasizes
human-readable
specifications
as
a
source
of
truth
for
behavior
while
retaining
a
strong
Java-based
implementation.
to
later
tools
like
Cucumber-JVM.
It
remains
in
use
in
some
projects,
though
activity
and
community
momentum
vary.