bdd crash course for testers (qa fest kiev, 31/10/2015)

23
BDD Crash Course for Testers Gaspar Nagy coach trainer bdd addict creator of specflow @gasparnagy [email protected] QA Fest Kiev 31/10/2015

Upload: gaspar-nagy

Post on 26-Jan-2017

597 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

BDD Crash Course for Testers

Gaspar Nagycoach • trainer • bdd addict • creator of specflow

@gasparnagy • [email protected]

QA Fest Kiev • 31/10/2015

Page 2: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Copyright © Gaspar Nagy

What is BDD?

Page 3: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Copyright © Gaspar Nagy

BDD?

BDD is a second-generation,

outside-in, pull-based, multiple-

stakeholder, multiple-scale, high-

automation, agile methodology.

It describes a cycle of interactions

with well-defined outputs, resulting

in the delivery of working, tested

software that matters.

Dan North, Agile Testing, Specifications and BDD Exchange 2009

Page 4: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Copyright © Gaspar Nagy

BDDBehavior Driven

Development

TDDTest Driven

Development

DDDDomain Driven Design

ATDDAcceptance Test

Driven Development

User Stories

Specification

by Example

Definition of

Done

Outside-In

Development

DSLDomain Specific

Language

Page 5: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Copyright © Gaspar Nagy

FEAR

Page 6: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

My Story

Agile

Engineering(XP, TDD,

pairing)

Agile

Project

Mgmt.(Scrum, Kanban)

Agile

Requirement

Analysis(User Story,

Acceptance

Criteria)

Agile

Testing(bug prevention,

exploratory

testing, context-

driven)

Page 7: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Bug Hunting → Bug Prevention

Page 8: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Copyright © Gaspar Nagy

Requirements vs. Tests

As formality increases, tests and

requirements become indistinguishable.

At the limit, tests and requirements are

equivalent.

Equivalence Hypothesis (Martin, Melnik)

Pic: Martin/Melnik: Requirements and Tests

Page 9: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Copyright © Gaspar Nagy

Specification-By-Example

Example Tests

Specifications

consist of

describe validate fulfillment

Source: Gojko Adzic – Bridging the Communication Gap

Page 10: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

My Story

Agile

Engineering(XP, TDD,

pairing)

Agile

Project

Mgmt.(Scrum, Kanban)

Agile

Requirement

Analysis(User Story,

Acceptance

Criteria)

Agile

Testing(bug prevention,

exploratory

testing, context-

driven)

BDD

Page 11: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Copyright © Gaspar Nagy

BDD

BDD =

Product Ownership +

Collaboration +

Automationon the product

of requirements

real

Page 12: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Team Foundation Server Version Control

TeamFoundation Server Workitems

SpecLog

Story Maps

Product Backlog

SprintBacklog

Task Board

SpecFlow ScenariosTest-auto-mation

Product

LivingDocumen-

tation

Our Process

Source: TechTalk (www.techtalk.at)

Page 13: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Planning a story with acceptance

criteria

“Imagine this story is

already implemented:

How would you verify

it?”

“I would try to put a book

into the shopping cart …”

“I would try to remove a

book from the shopping

cart…”

“I’d check whether the shopping

cart is empty, when I enter the

shop …”

Shopping cart should be

empty when entering the

shop

Source: TechTalk (www.techtalk.at)

Page 14: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Gherkin Scenarios

Scenario: Books can be added to the shopping basket

Given the following books

|Author |Title |

|Martin Fowler |Analysis Patterns |

|Gojko Adzic |Bridging the Communication Gap |

And my shopping basket is empty

When I add the book “Analysis Patterns” to my shopping basket

Then my shopping basket should contain 1 copy of “Analysis Patterns”

Page 15: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Copyright © Gaspar Nagy

DEMOSpecFlow in

Action

Page 16: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Copyright © Gaspar Nagy

Test automation is hard

Page 17: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Approach and Landing Tests

Source: https://en.Wikipedia.org/wiki/Approach_and_Landing_Tests

Page 18: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

An example of using stubs…

Source: https://en.Wikipedia.org/wiki/Approach_and_Landing_Tests

Page 19: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Copyright © Gaspar Nagy

Test-first thinking in designing

complex applications helps a lot for

test automation efficiency

Page 20: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Copyright © Gaspar Nagy

Test-first is hard

• When we exploring new areas/technologies

• When we need to work with legacy systems

• When …

But this should not be an excuse but a source of

inspiration!

Page 21: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Copyright © Gaspar Nagy

Page 22: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Copyright © Gaspar Nagy

SpecFlow

Course

Kiev

9-11 November

Page 23: BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

Thank you!

See you at on scrummaster.com.ua's booth!

Gaspar Nagycoach • trainer • bdd addict • creator of specflow

@gasparnagy • [email protected]