Geeks With Blogs

News This is the *old* blog. The new one is at
Elton Stoneman
This is the *old* blog. The new one is at

My latest Pluralsight course came out last month, and I’ve been so busy with the next one I haven’t blogged about it yet…

It’s all about Executable Specifications – defining requirements for software in a way that is testable, and testing the software meets the requirements using SpecFlow:

Executable Specifications: End-to-End Acceptance Testing With SpecFlow

The course looks at defining specifications that can be executed at different levels, to give confidence to different stakeholders. I cover feature-level acceptance tests, for the Product Owner and business stakeholders; technical acceptance tests for the Architect and design stakeholders; and negative acceptance tests for QA.

The focus is on end-to-end tests, where you flex the entry and exit points of your solution at a feature level. The demo solution uses a WPF admin UI and a public Web UI, both powered by a REST API over a SQL database. In the course I build SpecFlow tests which integrate with different test platforms to flex scenarios like:

Given that we have no more stock of the product 'fish-heads'
And the item is not to be re-ordered 
When I discontinue the item in the management portal 
Then the product is recorded as not available
And the stock count for the product is recorded as 0
And the product shows as not available on the website product list
And the availability for the product on the website product page shows the message
	| message                                     |
	| Sorry! This product is no longer available. |

In the SpecFlow steps, I demonstrate integrating with TestStack White to automate the WPF app, Selenium to automate the browser, and the native .NET HTTP and SQL clients to verify the API and database.

These are tests which prove your whole solution actually works, all the components work together, and the functionality does what the business users want it to do.

The course is delivered over five modules:

Introducing Executable Specifications

  • What executable specifications are, how they are used as acceptance tests
  • SpecFlow 101
  • What end-to-end testing gives you that other tests don’t

Acceptance Testing the Whole Stack

  • Integrating with SpecFlow to test all the parts of your solution
  • Automating WPF with SpecFlow + White
  • Automating Firefox with SpecFlow + Selenium
  • Verifying database changes

Acceptance Testing Outside the Stack

  • Integrating SpecFlow with stubs to verify your solution’s interaction with other components
  • Verifying emails are sent using a self-hosted SMTP stub with Papercut
  • Verifying Web services are called using a self-hosted WCF stub
  • Verifying messages are sent using MSMQ and a message handler stub

Technical Acceptance Tests

  • Using the same approach and tools for features which are non-functional requirements
  • API  testing – GETs with caching and PUTs with secure endpoints
  • API performance testing – automating through SpecFlow

Course Summary

  • Benefits of stating requirements as features
  • When to use end-to-end acceptance tests over unit tests

This is quality-focused course which looks at how you can build automated tests that everyone in the project understands, and which actually verify the correctness of the solution.

Posted on Wednesday, September 24, 2014 11:18 PM Pluralsight , SpecFlow | Back to top

Comments on this post: Executable Specifications: End-to-end Acceptance Testing with SpecFlow

# re: Executable Specifications: End-to-end Acceptance Testing with SpecFlow
Requesting Gravatar...
I've been watching parts of your course when I have time. Thank you! I've been interested in Spec Flow for awhile.

I'm finding my self writing some specs I want to share the Given so I don't have to duplicate the setup code, but I don't know if I'm thinking about it incorrectly or just can't find how to do it. Do you know of or have any examples?

Here's what I have:
Scenario: Delete Command on an existing deployment slot
Given The Production deployment slot is empty
When I try to delete the Production deployment slot
Then It should not thrown an exception and continue on

Create Prod Deployment slot
Given The Production deployment slot is empty
When I try to create the Production deployment slot
Then It should create the slot

Thank you.
Left by Kevin on Sep 25, 2014 2:34 PM

# re: Executable Specifications: End-to-end Acceptance Testing with SpecFlow
Requesting Gravatar...
I probably took the same PluralSight courses you did, but unless I missed something, the one thing missing was to actually *implement* the executable code that would cause the tests to pass for real. I've got a decent handle on SpecFlow and Gherkin, and navigating around VS, but the one thing I'm still missing is what you do in the Steps file (or elsewhere?) to get your production code to run.

For example if I have the default Feature file, it wants to add 50 + 70 and get 120. I generate the Steps file but I'm clueless about what to do with 50, 70, the Add button, and the resulting 120. Can you provide the final missing piece?

Left by Barry on Jan 02, 2015 9:22 PM

Your comment:
 (will show your gravatar)

Copyright © Elton Stoneman | Powered by: