Spa2011

20
Creating Cucumbers customers discussion collaboration acceptance language value Joseph Wilk Elise Huard

description

Workshop run at SPA2011.

Transcript of Spa2011

Page 1: Spa2011

CreatingCucumbers

customersdiscussioncollaboration

acceptance

languagevalue

Joseph Wilk

Elise Huard

Page 2: Spa2011

Cucumber FeatureFeature: Be awesome NarrativeScenario: title which rocks Given <some context> And <yet more context> When <some action> And <more actions> Then <some outcome> And <more outcomes>

Not executedExample of

behaviour

Steps

Page 3: Spa2011

Cucumber FeatureFeature: Be awesome NarrativeScenario: title which rocks Given <some context> And <yet more context> When <some action> And <more actions> Then <some outcome> And <more outcomes>

Not executed

Feature: Be awesome NarrativeScenario: title which rocks Given <some context> And <yet more context> When <some action> And <more actions> Then <some outcome> And <more outcomes>

Example of behaviour

Steps

Page 4: Spa2011

Ruby

Plaintext

Ruby

Plaintext

Plaintext

Ruby

Page 5: Spa2011

Ruby

Plaintext

Ruby

Plaintext

Plaintext

Given we like cukes

Ruby

Step

Page 6: Spa2011

Ruby

Plaintext

Ruby

Plaintext

PlaintextGiven /^we like (.*)$/i do |fruit| fruit.should == 'cukes'end

Given we like cukes

Ruby

Step

Stepdefinition

Page 7: Spa2011

Ruby

Plaintext

Ruby

Plaintext

PlaintextGiven /^we like (.*)$/i do |fruit| fruit.should == 'cukes'end

regexp match

Given we like cukes

Ruby

Step

Stepdefinition

Page 8: Spa2011

Cucumber Style?

Page 9: Spa2011

Problems

Global regular-expressions

Unmaintainable large step-definition files

Flexibility

Coverage vs. Speed tradeoffsComplex regular-expressions are hard to read

Page 10: Spa2011

Workshop:“The writing’s on the wall”

5mins per example

Page 11: Spa2011

Gherkin writing workshop

20mins

Page 12: Spa2011

Go - Weiqi - Baduk

Page 13: Spa2011
Page 14: Spa2011
Page 15: Spa2011

Feature

In order to prevent invalid moves

As a GoVsGO website member

I want the rules of Go enforced.

The Rules of Go

Page 16: Spa2011

Capture After playing his stone a player removes from the board any stones of his opponent's colour that have no liberties.

SuicideA player cannot place a stone that would result in the capture of their own stones

KoOne may not play in such a way as to recreate the board position following one's previous move

Ending The game ends when both players have passed consecutively

Go Rules

Page 17: Spa2011

How tasty is your Cucumber?

yum

Page 18: Spa2011

Learnings

Not Exhaustive, key examples(Maths book)

Does not dictateintegration testing

Allow features to breathe

Why?

Page 19: Spa2011

The Art of CucumberSeptember 27thSkillsmatters

http://theartofcucumber.eventbrite.com

Page 20: Spa2011

Thanks

Joseph Wilkhttp://blog.josephwilk.net

@josephwilk

Its been emotional

Elise Huardhttp://jabberwocky.eu

@elise_huard