bdd-birdseye-view-talk



bdd-birdseye-view-talk

1 0


bdd-birdseye-view-talk

Cucumber Groovy Talk

On Github marc0der / bdd-birdseye-view-talk

Behaviour Driven Development

A Birds Eye View

About Me

Marco Vermeulen

  • Software Developer
  • Worked for Shazam, Associated Newspapers, Burberry, Visa, HMRC
  • Current: Crowdmix, a Music Social Network
  • Creator of SDKMAN!
  • Blog: Wired for Code
  • Twitter: @marc0der

About the Talk

  • BDD in a Nutshell
  • The Good and the Bad
  • Impact Mapping
  • Three Amigos
  • Specification by Example
  • Q and A

BDD Defined

Straight from the horse's mouth:

#BDD in a tweet: Using examples at multiple levels to create a shared understanding and surface uncertainty to deliver software that matters

— Dan North (@tastapod) May 26, 2013

BDD in a Nutshell

Using Examples

at multiple levels

to create a shared understanding

and surface uncertainty

to deliver software

that matters!

So What?

  • Collaborate on a Specification that all understand.
  • Write in light weight Gherkin syntax.
  • Make Executable Specifications by parsing the syntax.
  • Watch Pending unimplemented tests fail!
  • Implement tests, watching them fail.
  • Write the Implementation, watch it pass!

Bad Wrap

An Orphaned Community

Bad Marketing Hype

ATDD (Acceptance Test Driven Development)

Lost it's Zing!!!

Cucumber Misunderstood

Cucumber - the worlds most misunderstood collaboration tool: https://t.co/BolhAB9D8L

— Cucumber Pro (@cucumber_pro) March 3, 2014

Good Vibrations

TDD Evolved

Inspires Collaboration

Behaviour vs Implementation

Living Documentation

Abundance of Tools

Simples!

Abundance of Tools

JBehave

Fitnesse

Concordian

EasyB

Spock?

Jasmine (for JavaScript)

Cucumber

Behaviour Driven Development

Impact Mapping

Impact Mapping

Impact mapping is a strategic planning technique that prevents organisations from getting lost while building products and delivering projects, by clearly communicating assumptions, helping teams align their activities with overall business objectives and make better roadmap decisions.

https://www.impactmapping.org/

Impact Mapping

What is it REALLY?!?

  • A Mind Mapping technique
  • Goals, Actors, Impacts and Features
  • Interactive
  • Communicative
  • Visual
  • Fast

Impact Mapping

The 4 BIG Questions

  • Why?
  • Who?
  • How?
  • What?

Impact Mapping

Why?

Why are we doing this?

  • High level goal for developing this software.
  • Don't focus on solutions.

Increase user conversion by 20% in 3 months.

Impact Mapping

Who?

Who will be Impacted?

  • Actors, impacted directly or indirectly.
  • Who can produce desired effect?
  • Who can obstruct it?
  • Who are the consumers or users of our product?
  • Be specific (not Users)

Under-18 users with mobile device at a concert.

Impact Mapping

How?

The effect on Actors.

  • How do we Impact the actors?
  • How should our actors’ behaviour change?
  • How can they help us to achieve the goal? or
  • How can they obstruct or prevent us from succeeding?

Impacts that move you forward. Business activities, not software features.

Purchasing tickets without calling a call center. Selling tickets faster.

Impact Mapping

What?

What can we do to support the required impacts?

The Deliverables or Features or Organisational Activities.

  • Least important level to get right!
  • Iteratively refine this.
  • Broken down to multiple levels on the Mind Map.
  • Items on the backlog.
  • Brings order to the backlog.

On-line ticket sales.

Mobile app with purchase facility.

Optimise call centre sales scripts.

Impact Mapping

Example

Online Gaming

Creating the Impact Map

Preparation Step 1

Discover Goals

  • Brainstorming Session
  • Ask probing questions
  • Expose Goals, not Features

Creating the Impact Map

Preparation Step 2

Define Good Measurements

Surface tangible Metrics Know if Goals were achieved

  • what we’ll measure (‘scale’)
  • how we’ll measure it (‘meter’)
  • what the situation is like now (‘benchmark’)
  • the minimum acceptable value, break-even
  • for investment (‘constraint’)
  • the desired value (‘target’)

Creating the Impact Map

Preparation Step 3

Plan First Milestone

  • Extract single most important Objective
  • Make it a realistic Objective
  • Vote on it if necessary
  • Try not to think too far ahead!

Creating the Impact Map

Mapping Step 1

Draw the Map Skeleton

  • Place first Milestone in the Middle
  • Add Actors, Impacts and Features
  • Use existing backlog
  • Does not have to be correct!
  • Refine by asking questions

Creating the Impact Map

Mapping Step 2

Find Alternatives

  • Divergent thinking
  • Brainstorming
  • Accept all ideas
  • Try to find better/cheaper solutions
  • Include manual process

Creating the Impact Map

Mapping Step 3

Identify Key Priorities

  • Convergent thinking
  • Identify obstructions
  • Identify low hanging fruit
  • Test key assumptions

Creating the Impact Map

Mapping Step 4

Introduce Features

Grow list of Deliverables/Features

  • What is the simplest way to support this activity?
  • What else could we do?
  • Could we start earning with a partly manual process?

Behaviour Driven Development

Ubiquitous Language

Domain Driven Design by Eric Evans

Behaviour Driven Development

Ubiquitous Language

What it is

  • Speak a Common Language
  • Originates from Domain Experts
  • Adopted by Technical People
  • Code should reflect Real World
  • Must not deviate!

Behaviour Driven Development

Ubiquitous Language

What can go wrong?

  • Dislocated, can't function
  • Growing Rift between Experts and Developers
  • Project will fail

Behaviour Driven Development

Ubiquitous Language

Recovery

  • Foster relationships
  • Work side-by-side
  • Glossary of Terms
  • Three Amigos!

Behaviour Driven Development

Three Amigos

Wat?!?

  • An Example Workshop
  • Many Disciplines
  • Collaboration
  • Iron out disagreement & misunderstanding
  • Write Specifications

Behaviour Driven Development

Three Amigos

Roles

  • Product Owner
  • Business Analyst
  • QA
  • Developer
  • User Experience
  • Designer

Behaviour Driven Development

Three Amigos

Outcome

  • Agreement!
  • No Misunderstandings
  • Specification for Feature
  • No Boomerangs!

Behaviour Driven Development

Specification by Example

Feature Files

  • File name lower-cased with underscores.
  • feature extension
  • Plain text file
  • Have a very light markup
  • Human readable, Machine parsable

Behaviour Driven Development

Specification by Example

Feature Header

  • One line, from Feature Injection
  • First line prefixed by Feature keyword
  • A multi-line description
  • Express intent of Feature, as per Impact Map
Feature: The Feature Title
  In order to <meet some goal>
  As a <type of actor>
  I want <a feature>

the_feature_title.feature

Behaviour Driven Development

Specification by Example

Background

  • Similar to @BeforeAll in JUnit
  • Sets up a long running fixture
  • Has multiple Given, When, Then and And
Background:
  Given a precondition
  And another precondition

Behaviour Driven Development

Specification by Example

Scenario

  • Describes a single Example
  • Exercises single path of execution
  • Has combination of Given, When, Then and And
  • Given - arrange
  • When - act
  • Then - assert

      Scenario:
        Given something established
        When I perform an action
        Then I see the result
        And I see something else

Behaviour Driven Development

Specification by Example

Pitfalls

  • Beware! Incidental Detail!
  • Specification to be relevant to Audience
  • Keep Scenarios independent
  • Be Disciplined about Clean Code!
  • Keep It Simple Stupid (KISS)

Conclusion

  • BDD provides a holistic delivery method
  • BDD helps us Collaborate
  • BDD helps us think beyond our role
  • BDD helps us think out of the box
  • BDD helps us make software that Matters!
  • BDD is lots of fun!

Thank You!!!

Q & A