Posted on:

Welcome to SpecFlow!

Note: This guidance page is customized for displaying inside Visual Studio. You can also visit our website at http://www.specflow.org for more details, or hover your mouse over the purple line above to access the website menu.


SpecFlow aims to bridge the communication gap between domain experts and developers by binding business readable behaviour specifications and examples to the underlying implementation. Our mission is to provide a pragmatic and frictionless approach to Specification-By-Example for .NET projects. SpecFlow also supports the concepts of Acceptance Test Driven Development (ATDD) and Behavior Driven Development (BDD), which are often used synonymously with Specification-By-Example.

As a part of the Cucumber family, SpecFlow uses the official Gherkin parser and provides integration for the .NET framework, Silverlight, Windows Phone and Mono.

(Have you used SpecFlow already? Continue reading the “What’s New” guide.)

First Steps

This section guides you through the first steps of setting up your SpecFlow project and creating your first scenario. In the example, we will use SpecFlow with NUnit, but you can choose from many other test execution frameworks, including SpecFlow+Runner, which provides specialized execution features, Visual Studio Test Window and Team Foundation Server (TFS) Build integration for SpecFlow.

Get your first SpecFlow test running in just a few steps:

  1. Create a class library project: MyProject.Specs

    If you want to use SpecFlow with MsTest in VS2010, you should start with a “Unit Test Project”

  2. Add SpecFlow for NUnit through NuGet

    Instead of NUnit, you can also use other test engines, like MsTest, xUnit, MbUnit or SpecFlow+Runner

    PM> Install-Package SpecFlow.NUnit
  3. Add your first feature file

    We are writing yet another StackOverflow clone: SpecOverflow

    Add a new feature file to the project
  4. Describe the first scenario in your application

    The first scenario
  5. Generate step definition skeletons

    Cool new feature in v1.9!

    Invoke step definition skeleton generation from the context menu
  6. Run your test – it is not green yet

    Use your favorite test runner, like the VS2012 test runner below; but it works well with ReSharper too…

    Running the test returns an inconclusive result
  7. Implement automation & application logic until the test is green

    The test finally passes
  8. Celebrate the good work and continue with the next scenario!

Want to learn more?

Explore the SpecFlow eco-system

Check out the products that make SpecFlow even more powerful!

  • SpecFlow+ Runner (formerly known as SpecRun) – smart, integrated test runner for SpecFlow
  • SpecFlow+ Excel – collaborate with business partners using Given/When/Then directly in Excel
  • SpecLog – build up a living documentation based on SpecFlow
  • Contact us if you want to be listed here!