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 loader.io 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.