6. Acceptance Tests
Business Analyst + Tester:
- Write clear requirements
- Uses consistent language (DSL)
- Cover all scenarios
Developer:
- Write code to make the requirement work
- Write test matching the requirement (verbatim)
Result: What you ask for is what will be built (and tested)
10. A simple application
Calculates Discount on a website:
- For NJ or PA residents 10%
- For software developers 10%
- For Senior Citizens 15%
- For everyone else 5%
11. How would you write the requirements?
- If I am a NJ resident, I expect a 10% discount
- If I am a PA resident, I expect a 10% discount
- If I am a developer, I expect a 10% discount
- If I am a senior citizen, I expect a 15% discount
- I am a CA resident, a realtor, not a senior citizen. I expect 5% discount
15. Demo
- Test the calculator feature (API test)
- Test the website using the same feature (end-to-end test)
- Common implementation across languages - do it in another language (Java)
https://github.com/ravirepo/cucumber-dotnet
https://github.com/ravirepo/cucumber-java
19. BDD
- Requirements are in Given/When/Then format (or close)
- Requirements cover all scenarios
- Write acceptance tests (failing)
- Write code to make tests pass
Benefits:
- Living documentation
- No unused code and No requirement missing!
https://cucumber.io/bdd/