Top Banner
Specification by example What? How? When? Marcus Hammarberg
118

Specification by Example

Sep 18, 2014

Download

Technology

These are the slides for my Specification by example presentation. This particular version was given as part of my "I'm telling you for the last time"-series (see http://www.marcusoft.net/2013/11/ImTellingYou.html).
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Specification by Example

Specification by example What? How? When?

Marcus Hammarberg

Page 2: Specification by Example
Page 3: Specification by Example
Page 4: Specification by Example
Page 5: Specification by Example
Page 6: Specification by Example
Page 7: Specification by Example
Page 8: Specification by Example
Page 9: Specification by Example
Page 10: Specification by Example
Page 11: Specification by Example
Page 12: Specification by Example
Page 13: Specification by Example
Page 14: Specification by Example
Page 15: Specification by Example

http://www.youtube.com/aptitudsthlm

Page 16: Specification by Example

Bandung

Page 17: Specification by Example
Page 18: Specification by Example
Page 19: Specification by Example

Theory of Constraints

Page 20: Specification by Example

Where is our bottleneck?

Page 21: Specification by Example
Page 22: Specification by Example

http://images.nationalgeographic.com/wpf/media-live/photos/000/212/cache/sinkholes-holes-ground-2007-guatemala-sinkhole_21282_600x450.jpg

Page 23: Specification by Example
Page 24: Specification by Example

Deliberate Discovery

Page 25: Specification by Example
Page 26: Specification by Example

Gojko Adzic

Page 27: Specification by Example
Page 28: Specification by Example

... it’s no silver bullet, but it seems

like a good start

Dan North

Page 29: Specification by Example

http://manning.com/adzic/From Specification by Example

Used with permission

Page 30: Specification by Example

http://www.wallpaperpimper.com/wallpaper/Military/F_16_Fighting_Falcon/F-16-Fighting-Falcon-20-9XTZMAN20G-1280x1024.jpg

Page 31: Specification by Example

http://www.wallpaperpimper.com/wallpaper/Military/F_16_Fighting_Falcon/F-16-Fighting-Falcon-20-9XTZMAN20G-1280x1024.jpg

Page 32: Specification by Example

Who sets scope?

http://2.bp.blogspot.com/-mJ8gPBlBRjY/TcYv9xOuWlI/AAAAAAAAKvY/0JniIDxlBjY/s1600/how-to-get-your-boss-off-your-back.jpg

Page 33: Specification by Example

How do they know what they want?

Page 34: Specification by Example

How do they know what they want?

Page 35: Specification by Example

Don’t let the customer

limit themselves

http://www.realestateradiousa.com/blog/wp-content/uploads/2008/09/straitjacket.jpg

Page 36: Specification by Example

Derive scope from business goals

http://cojent7.files.wordpress.com/2010/04/business-goals1.jpg

Page 37: Specification by Example

Build the right thing!

Page 38: Specification by Example
Page 39: Specification by Example
Page 40: Specification by Example
Page 41: Specification by Example
Page 42: Specification by Example
Page 43: Specification by Example
Page 45: Specification by Example
Page 46: Specification by Example
Page 47: Specification by Example

1. Start with wide end of it on your right and extending a foot below the narrow end 2. Cross wide end over narrow and turn back underneath 3. Bring up and turn down to loop 4. Pass wide end around frong from left to right 5. Then, up through loop ... 6. And down through knot in front. Tigthen carefully and draw up to collar.

Page 48: Specification by Example
Page 49: Specification by Example

Go concrete with exampleshttp://www.flickr.com/photos/bensutherland/3961418687/

Page 50: Specification by Example

Scenario 1: Account is in credit!Given the account is in credit!And the card is valid!And the dispenser contains cash!When the customer requests €50!Then ! ensure the account is debited €50!And ensure €40 is dispensed!And ensure the card is returned

Page 51: Specification by Example

Key examples

Page 52: Specification by Example

Key examples

http://www.bigideastobigresults.com/wp-content/uploads/2009/09/good_enough.jpg

Page 53: Specification by Example

Let’s try that, shall we?

Page 54: Specification by Example

Customers who buys three books gets free shipping

Page 55: Specification by Example

Customers who buys three books gets free shipping

Number of books Free shipping?

Page 56: Specification by Example

Customers who buys three books gets free shipping

Number of books Free shipping?1 -

Page 57: Specification by Example

Customers who buys three books gets free shipping

Number of books Free shipping?

21

--

Page 58: Specification by Example

Customers who buys three books gets free shipping

Number of books Free shipping?

23

1-X

-

Page 59: Specification by Example

Customers who buys three books gets free shipping

Number of books Free shipping?

234

1-XX

-

Page 60: Specification by Example

To get a loan you need to be older than 18

Page 61: Specification by Example

To get a loan you need to be older than 18

Age of applicant Can take loan?

Page 62: Specification by Example

To get a loan you need to be older than 18

Age of applicant Can take loan?17 -

Page 63: Specification by Example

To get a loan you need to be older than 18

Age of applicant Can take loan?

1817

X-

Page 64: Specification by Example

To get a loan you need to be older than 18

Age of applicant Can take loan?

1819

17XX

-

Page 65: Specification by Example

To get a loan you need to be older than 18

Age of applicant Can take loan?

1819null?

17XXeeeeh?

-

Page 66: Specification by Example
Page 67: Specification by Example
Page 68: Specification by Example

http://www.flickr.com/photos/toastytreat/4555895229

Text

Who writes this stuff anyway?

Page 69: Specification by Example

Refactor the specification

Page 70: Specification by Example
Page 71: Specification by Example

Examples should be precise and testable

Page 72: Specification by Example

Examples should be precise and testable

Scripts are not specifications

Page 73: Specification by Example

Examples should be precise and testable

Scripts are not specifications

Specifications should be about business functionality, not software design

Page 74: Specification by Example

Examples should be precise and testable

Scripts are not specifications

Specifications should be about business functionality, not software design

Specifications should be self-explanatory

Page 75: Specification by Example

Examples should be precise and testable

Scripts are not specifications

Specifications should be about business functionality, not software design

Specifications should be self-explanatory

Specifications should be in domain language

Page 76: Specification by Example
Page 77: Specification by Example

Sharedunderstanding

Page 78: Specification by Example

Sharedunderstanding

Testing

Page 79: Specification by Example

Sharedunderstanding

Testing

Documentation

Page 80: Specification by Example
Page 81: Specification by Example
Page 82: Specification by Example
Page 83: Specification by Example
Page 84: Specification by Example
Page 85: Specification by Example
Page 86: Specification by Example
Page 87: Specification by Example

Automation

http://jbehave.org/reference/stable/images/jbehave-logo.png

http://lh5.ggpht.com/_X3kaawac_g4/S0nxyUKaIYI/AAAAAAAAAu0/CtKaMavsxoM/cucumber.jpg?imgmax=800

http://lh6.ggpht.com/_X3kaawac_g4/SuoT1Yd67pI/AAAAAAAAArU/dhE-WLR0VKE/Unbenannt.png?imgmax=800

Page 88: Specification by Example

A Cucumber ScenarioScenario 1: Account is in credit!Given the account is in credit!And the card is valid!And the dispenser contains cash!When the customer requests €50!Then ! ensure the account is debited €50!And ensure €50 is dispensed!And ensure the card is returned

Page 89: Specification by Example
Page 90: Specification by Example
Page 91: Specification by Example
Page 92: Specification by Example
Page 93: Specification by Example
Page 94: Specification by Example

http://1.bp.blogspot.com/-3yjyeeTpRFI/Tea15VHttaI/AAAAAAAAC3w/YXoTDAv9tx8/s1600/hard_work.png

Page 95: Specification by Example
Page 96: Specification by Example
Page 97: Specification by Example
Page 98: Specification by Example

One document to rule them all ...

Page 99: Specification by Example

http://www.questpartnership.co.uk/blog/uploaded_images/restructuring-775119.jpg

Page 100: Specification by Example
Page 101: Specification by Example

“... features are an executable map of the current functionality of the system.”

Andrew Premdas (BDD Google Group)

Page 102: Specification by Example
Page 103: Specification by Example

ToC and Specification by example

Page 104: Specification by Example

ToC and Specification by example

• Better communication

Page 105: Specification by Example

ToC and Specification by example

• Better communication

• Concrete examples

Page 106: Specification by Example

ToC and Specification by example

• Better communication

• Concrete examples

• Frequent validation

Page 107: Specification by Example

ToC and Specification by example

• Better communication

• Concrete examples

• Frequent validation

• Living documentation

Page 108: Specification by Example

Learn more

Page 109: Specification by Example

Learn more

Page 110: Specification by Example

Learn more

Page 111: Specification by Example

Learn more

Page 112: Specification by Example

Learn more

Page 113: Specification by Example

Learn more

Page 114: Specification by Example
Page 115: Specification by Example

www.marcusoft.net @marcusoftnet

[email protected]

Page 116: Specification by Example

www.marcusoft.net @marcusoftnet

[email protected]

Page 117: Specification by Example

Recording of this talk http://www.youtube.com/

aptitudsthlm

Page 118: Specification by Example