1 / 9

BDD with SpecFlow

BDD with SpecFlow. Why BDD?. BDD helps build the right thing. Traditionally there are many handoffs - Requirements, development, component testing, integration testing and finally customer usage. BDD shares a specification through all stages of development. Why BDD?.

morley
Download Presentation

BDD with SpecFlow

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. BDD with SpecFlow

  2. Why BDD? • BDD helps build the right thing. • Traditionally there are many handoffs - Requirements, development, component testing, integration testing and finally customer usage. • BDD shares a specification through all stages of development.

  3. Why BDD? • BDD documents what is actually built • Documentation reflects how the system actually behaves. • Documentation is up-to-date and accurate. • Good for long-term maintenance. • Good for training new staff. • Good for communicating with other teams.

  4. How BDD? • Up front, Product Managers, developers and QA define the behavior of the system collaboratively. • They write a specification. • The specification defines what Product Owners want, what developers build and what QA tests. • The specification is used as a target for implementation and a means to validate the product.

  5. Why not TDD? • Details are lost when translating from business requirements to traditional MSTest unit tests. • With many handoffs it’s very easy to have a full set of tests and still build the wrong software. • MSTest functional tests are inaccessible to product stakeholders.

  6. BDD Frameworks: xBehave or xSpec? • SpecFlow is xBehave-based • xBehave Benefit: stakeholders can read and understand the tests • Comparison: http://stackoverflow.com/questions/307895/what-is-the-most-mature-bdd-framework-for-net

  7. SpecFlow Overview • SpecFlow adds a thin layer on top of traditional automated tests. • Specification - readable text • Binding - maps from readable text->code • MSTest (Behind the scenes) • Traditional Automated Tests • MSTest -> System • SpecFlow Tests • Specification -> Binding -> MSTest -> System

  8. SpecFlow - One Time Setup • Install Visual Studio Plugin • nuget: Install-Package SpecFlow • Add to app.config: <specFlow> <unitTestProvider name=”MsTest”/> </specFlow>

  9. Next Steps • Install Visual Studio Plugin: • http://visualstudiogallery.msdn.microsoft.com/9915524d-7fb0-43c3-bb3c-a8a14fbd40ee • Does SpecFlow replace all our functional tests? No... not yet. • SpecFlow - Workflow & key examples • Traditional Functional Tests - everything else

More Related