(a)tdd the what, why and how
DESCRIPTION
Discusses Acceptance Test Driven Development and Behavior Driven Development with Specflow.TRANSCRIPT
ATDD, BDD, TDD
Alexander van Trijffel18-09-2013
The what, why and how
INTRODUCTION• Behavior Driven Development & Acceptance Test Driven Development
• Building the Right Code
• Test Driven Development
• Building the Code Right
ACCEPTANCE TEST DRIVEN DEVELOPMENT• What
• Process for defining automated acceptance tests early in the development process
• Why
• Ensure that all project members understand precisely what needs to be done and implemented
• How
• Tools: Specflow (.NET), Jasmine (JavaScript), Cucumber (Ruby), Fitnesse+FitSharp
BEHAVIOR-DRIVEN DEVELOPMENT• What
• Framework for defining automated acceptance tests to assert whether the system does what it is supposed to do (is the expected functionality implemented?)
Given [condition], when [action], then [expectation]
• Why
• Provides guidance on organizing the conversation between developers, testers and domain experts
SPECFLOW• Tester, business analyst and developer discuss requirements and write feature with
Given [ ], When [ ], Then [ ] specification
• Developer writes step definitions (glue code) that act on the target system
• Tests are executed similar to unit tests
DEMO SPECFLOW
CASE MOVIE TICKETING SYSTEM• Stories
• As an employee, I want to add groups of visitors so that ticket prices can be calculated
• As an employee, I want to calculate total ticket prices for groups so that I can charge the customer
• Ticket prices
Adult Children€ 8,-- €5,--
TEST DRIVEN DEVELOPMENT• What
• Writing automated tests to test whether code works correctly
• Why
• Improves code quality
• Automated regression tests support refactoring
• How
• TDD Cycle:
• a) Write executable, failing test
• b) Write minimum amount of code to make the test pass
• c) Refactor
DEMO SPECFLOW
THANKS