
f778c2b67b058dcb1c601c24561ebebd.ppt
- Количество слайдов: 9
BDD with Spec. Flow
Why BDD? 1. 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? 2. 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.
How BDD? developers • Up front, Product Managers, 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.
Why not TDD? 1. Details are lost when translating from business requirements to traditional MSTest unit tests. 2. With many handoffs it’s very easy to have a full set of tests and still build the wrong software. 3. MSTest functional tests are inaccessible to product stakeholders.
BDD Frameworks: x. Behave or x. Spec? • Spec. Flow is x. Behave-based • x. Behave Benefit: stakeholders can read and understand the tests • Comparison: http: //stackoverflow. com/questions/30 7895/what-is-the-most-mature-bddframework-for-net
• Spec. Flow Overview Spec. Flow adds a thin layer on top of traditional automated tests. 1. Specification - readable text 2. Binding - maps from readable text->code 3. MSTest (Behind the scenes) • • Traditional Automated Tests • MSTest -> System Spec. Flow Tests • Specification -> Binding -> MSTest -> System
Spec. Flow - One Time Setup 1. Install Visual Studio Plugin 2. nuget: Install-Package Spec. Flow 3. Add to app. config: <spec. Flow> <unit. Test. Provider name=”Ms. Test”/> </spec. Flow>
Next Steps • Install Visual Studio Plugin: http: //visualstudiogallery. msdn. microsoft. com/ 9915524 d-7 fb 0 -43 c 3 -bb 3 c-a 8 a 14 fbd 40 ee • Does Spec. Flow replace all our functional tests? No. . . not yet. • • Spec. Flow - Workflow & key examples Traditional Functional Tests - everything else
f778c2b67b058dcb1c601c24561ebebd.ppt