(a)tdd the what, why and how

13
ATDD, BDD, TDD Alexander van Trijffel 18-09-2013 The what, why and how

Upload: alexander-van-trijffel

Post on 01-Nov-2014

288 views

Category:

Technology


2 download

Tags:

DESCRIPTION

Discusses Acceptance Test Driven Development and Behavior Driven Development with Specflow.

TRANSCRIPT

Page 1: (A)TDD The what, why and how

ATDD, BDD, TDD

Alexander van Trijffel18-09-2013

The what, why and how

Page 2: (A)TDD The what, why and how

INTRODUCTION• Behavior Driven Development & Acceptance Test Driven Development

• Building the Right Code

• Test Driven Development

• Building the Code Right

Page 3: (A)TDD The what, why and how

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

Page 5: (A)TDD The what, why and how

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

Page 6: (A)TDD The what, why and how
Page 7: (A)TDD The what, why and how

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

Page 8: (A)TDD The what, why and how

DEMO SPECFLOW

Page 9: (A)TDD The what, why and how

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,--

Page 10: (A)TDD The what, why and how

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

Page 11: (A)TDD The what, why and how

DEMO SPECFLOW

Page 12: (A)TDD The what, why and how
Page 13: (A)TDD The what, why and how

THANKS