30
Emily Bache, Bache Consulting & Pagero Readable, Executable Requirements: Hands-On @esconfs #esconfs Insert speaker picture here, no more than 150x150 pixels

Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Embed Size (px)

DESCRIPTION

EuroSTAR Software Testing Conference 2013 presentation on Readable, Executable Requirements: Hands-On by Emily Bache. See more at: http://conference.eurostarsoftwaretesting.com/past-presentations/

Citation preview

Page 1: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Emily Bache, Bache Consulting & Pagero

Readable, Executable Requirements: Hands-On

@esconfs#esconfs

Insert speaker picture here, no more than 150x150 pixels

Page 2: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013
Page 3: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Agile Requirements

User Story Conversation+ Example+

From “Agile Testing” by Crispin, Gregory

Requirement=

3

Page 4: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

ATDD vs BDD vs Spec by Example?

Where we choose to call it BDD or ATDD or Specification by Example, we want the same result – a shared common understanding of what is to be built to try to build the ‘thing’ right the first time.

-- Janet Gregory

http://janetgregory.blogspot.se/2010/08/atdd-vs-bdd-vs-specification-by-example.html 4

Page 5: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Thought LeadersATDD:◦ Janet Gregory, Lisa Crispin, Markus Gärtner

Specification by Example:◦Gojko Adzic, David Evans

BDD:◦Liz Keogh, Dan North, Chris Matts

5

Page 6: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

TDD inner & outer loops

from “Growing Object Oriented Software, Guided by Tests” by Freeman, Pryce

Write a failing unit test

make the test passrefactor

Write a failing acceptance test

6

Page 7: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

TDD won’t help you if...

You don’t know what problem to solve

Write a failing unit test

make the test passrefactor

7

Page 8: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

TDD is less useful if... you tend to have a lot of integration errors

8

Write a failing unit test

make the test passrefactor

Page 9: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

TDD inner & outer loops

from “Growing Object Oriented Software, Guided by Tests” by Freeman, Pryce

Write a failing unit test

make the test passrefactor

Write a failing acceptance test

9

Where does this come from?

Page 10: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Agile Requirements

User Story Conversation Example

Requirement

+ +

From “Agile Testing” by Crispin, Gregory

=

10

Example => Acceptance Test

Page 11: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Features + User Stories

User Story: A slice through a feature that can be built in 1-2 days

FeatureAs a <stakeholder>I want <feature>So that <benefit>

11

Business Analyst

Page 12: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Agile Requirements

User Story Conversation Coaching Test

Requirement

+ +

From “Agile Testing” by Crispin, Gregory

=

12

Page 13: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Conversation: combine perspectives

Developer

Business AnalystTester

“The Three Amigos”

+ other stakeholders

13

Page 14: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

A Feature has many Scenarios

ScenarioGiven <assumption>When <event>Then <outcome>

14

FeatureAs a <stakeholder>I want <feature>So that <benefit>

ScenarioGiven <assumption>When <event>Then <outcome>

Page 15: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Discovering Scenarios

Developer

Business AnalystTester

“The Three Amigos”

+ other stakeholders

Scenarios are concrete examples

discovered through conversation

15

Page 16: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Feature & Scenario

Feature: Free DeliveryAs an online retailerI want to offer free delivery to customers who place larger ordersSo that customers spend more money on our siteScenario: Customer qualifies for Free DeliveryGiven my shopping basket contains 550:- of goodsWhen I place an orderThen I am offered free delivery

16

Page 17: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Discover Scenarios in Conversation

Feature: Free Delivery

Scenario: Order is large enough

Scenario: Order total is too low

Scenario: VIP Customer

Scenario: Customer chooses express delivery instead

Scenario: Customer has bad payment history

Scenario: Customer lives overseas

Page 18: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

As an online retailerI want to offer free delivery to customers who place larger ordersSo that customers spend more money on our site

Order total Destination Free delivery?500:- Sweden yes499:- Sweden no500:- Norway yes500:- France no

Table format

Page 19: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Deliberate Discovery

Developer

Business AnalystTester

Bugs often come from missed scenarios

19

Is there another context in which this event will create a different outcome?

Is this the only outcome that matters?

Page 20: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Agile Requirements

User Story Conversation Examples

Requirement

+ +

From “Agile Testing” by Crispin, Gregory

=

20

Page 21: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

A comprehensive regression test suite?

Having the conversation is the most important thing

write down the scenarios you need to remember

automate the important ones

Automation should make things easier to change, not harder!

21

Developer

Business AnalystTester

Page 22: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Write Code

Code & unit tests Scenarios automated as functional tests

Testers

Collaborate

Developers

22

Page 23: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Scenario -> Regression test

BEFORE code is written, it’s a requirement specification

AFTER code is written it’s a regression test

Important to preserve the language & format

23

Living Documentation

Page 24: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

When the code “works”

Developer

Business AnalystTester

“The Three Amigos”

+ other stakeholders

Close the feedback loop Check scenarios, do manual testing

Continue to run automated regression tests

24

Page 25: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Using Cucumber

Feature

System Under Test (SUT)

Step Definitions

http://cukes.info

Page 26: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Exercise: FizzBuzz

Press “Start”Note your animal

26

http://54.228.126.85/?id=A7F4BF65F2

Page 27: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

FizzBuzz - solution

http://54.228.126.85/?id=CBF012F624

27

Page 28: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Exercise: Gilded Rose

Existing System Complicated existing Requirements New Requirement

Page 29: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

GildedRose - solution

http://54.228.126.85/?id=DC3E0B2C26

29

Page 30: Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013

Exercise: Gilded Rose

Press “Start”Note your animal

30

http://54.228.126.85/?id=BD2E43F85E