Home

SpecFlow

SpecFlow is an open-source Behavior-Driven Development (BDD) framework for the .NET platform. It draws inspiration from Cucumber and enables teams to define application behavior in human-readable feature files written in the Gherkin language. Each feature contains scenarios described with Given, When, Then steps, as well as Backgrounds and Scenario Outlines with Examples.

SpecFlow links these natural-language steps to executable code by binding step definitions in C# (or VB.NET).

The framework integrates with .NET test ecosystems, supporting NUnit, MSTest (VSTest), and xUnit. It can be used

SpecFlow also offers a Visual Studio extension to improve editing of feature files and step definitions, including

Overall, SpecFlow helps translate acceptance criteria into automated tests, providing a bridge between non-technical stakeholders and

Step
definitions
are
methods
annotated
with
binding
attributes
such
as
[Binding],
[Given("pattern")],
[When("pattern")],
and
[Then("pattern")],
or
by
using
regular
expressions.
At
runtime,
the
test
framework
runs
the
bound
methods
when
the
corresponding
Gherkin
steps
are
encountered.
with
the
SpecFlow+
Runner
for
enhanced
features
such
as
parallel
execution
and
richer
reporting,
though
standard
test
runners
may
also
be
employed.
A
typical
project
includes
feature
files
alongside
their
corresponding
step
definition
files,
with
the
SpecFlow
NuGet
package
handling
code
generation
and
execution
glue.
syntax
highlighting
and
IntelliSense.
Additional
tooling
is
available
for
living
documentation
and
reports,
such
as
SpecFlow
Living
Documentation.
developers
within
the
.NET
ecosystem.