bdd: there's more to it than you think

35
BDD It’s not just ‘given-when-then’

Upload: wakaleo-consulting

Post on 20-Aug-2015

1.456 views

Category:

Technology


0 download

TRANSCRIPT

BDD

It’s not just ‘given-when-then’

John Ferguson Smart

Consultant  Trainer  Mentor  Author  Speaker  Coder

So what is this BDD thing?Scenario:  Learning  About  Qantas     Given  I  am  on  the  Wikipedia  home  page     When  I  search  for  'Qantas'  in  'English'     Then  I  should  see  the  'Qantas'  wikipedia  entry

A  Test  Automa6on  Tool?

So what is this BDD thing?Scenario:  Learning  About  Qantas     Given  I  am  on  the  Wikipedia  home  page     When  I  search  for  'Qantas'  in  'English'     Then  I  should  see  the  'Qantas'  wikipedia  entry

A  way  to  write  acceptance  criteria?

So what is this BDD thing?Scenario:  Learning  About  Qantas     Given  I  am  on  the  Wikipedia  home  page     When  I  search  for  'Qantas'  in  'English'     Then  I  should  see  the  'Qantas'  wikipedia  entry

A  way  to  define  requirements?

BDD

Feature InjectionAutomated Acceptance

Criteria

API and code design

Collaboration

Building the software right

Building the right software

Living Documentation

“Having  the  conversa/on    is  more  important  than    

recording  the  conversa/on  is  more  important  than    

automa/ng  the  conversa/on”  -­‐  Liz  Keogh

BDD  starts  with  conversa6on

Feature  Injec6on

Hunt  the  value!

Why do we build any feature?

Increase  Revenue

Protect  Revenue

Reduce  Costs

Avoid  Future  Costs

Examples/Scenarios

Stories

Features

Capabilities

Goals

Acceptance Criteria

Where do features come from?

Features guide the development process

But knowing why we build a feature is even better

To increase ticket sale revenue

Why Who How

travellers take the train more often

suggest taking the train to

friends

What

online booking

social network integration

concessions

credit card payment

Story

bug  reports

Working  code boring  

manual  tes:ng

WASTEBA

Developer

Tester

Many teams build features like this…

Collabora6on

…but a little cooperation goes a long way…

Working  code    and    

Working  Automated  Acceptance  Tests Exploratory  tes:ng,  

usability  tes:ng...

Shared  understanding

StoryExamplesAutomated  acceptance  criteria

Collabora6on

We call this “The Three Amigos”

BA  and/or  product  owner

Tester Developer Automatable  Acceptance  Criteria

Shared  understanding

Collabora6on

Collabora6on

We call this “The Three Amigos”

“Automation without collaboration is empty”

Scenario

Step  Defini6ons

Low  level  specifica6ons  (aka  “unit  tests”)

Applica6on  Code

API  and  Code  Design

Oh, the things you can learn…

API  and  Code  Design

What  would  we  like  the  API  to  look  like?

API  and  Code  Design

Then  write  low-­‐level  specifica6ons  for  the  code

API  and  Code  Design

Then  write  low-­‐level  specifica6ons  for  the  code

API  and  Code  Design

“Every class is an API for someone”

Living  Documenta6on

Living  Documenta6on

A  star:ng  point  for  manual  tests

Illustrates  delivered  features

Func:onal  and  technical  documenta:on

Progress  repor:ng

Living  Documenta6on

Scenario: Searching by keyword Given Sally wants to buy a puppy for her son When she looks for ads in the Pets & Animals category containing puppy Then she should obtain a list of ads for puppies for sale

Living  Documenta6on

Living  Documenta6on

High level requirements (capabilities)

Living  Documenta6on

A capability

Features that support this capability

Living  Documenta6on

Details for a feature

Stories for this feature

Living  Documenta6on

Pending story

Acceptance criteria for this story

Living  Documenta6on

Acceptance criteria

Acceptance criteria details

“Living Documentation completes the circle”

In conclusion…

It’s  behaviour  all  the  way  down

Thank You

John Ferguson Smart

[email protected]

wakaleo

http://www.wakaleo.com