SlideShare a Scribd company logo
1 of 117
Konstantin K. @everzet
Taking back
Behaviour Driven Development
The User-story
    In  order  to  spend  more  time  socialising  at  the  conference  
    instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
What is BDD?
Can you give me an
example of how you
would do it?
Scenarios in imperative style
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  
        Given  there  is  a  conference  "XP  Conference"  
        And  there  is  a  "Specification"  talk  in  first  time  period  
        When  I  open  the  "/conferences/xp"  page  
        And  I  click  "Add  to  my  schedule"  inside  ".talk:contains('Specification')"  block  
        Then  I  should  see  ".talk:contains('Specification')"  inside  ".personal-­‐schedule"  block  
    Scenario:  Failing  to  select  2  talks  into  the  time  period  
        Given  there  is  a  conference  "XP  Conference"  
        And  there  is  a  "Specification"  talk  in  the  first  time  period  
        And  there  is  a  "Modelling"  talk  in  the  first  time  period  
        When  I  open  the  "/conferences/xp"  page  
        And  I  click  "Add  to  my  schedule"  inside  ".talk:contains('Specification')"  block  
        And  I  click  "Add  to  my  schedule"  inside  ".talk:contains('Modelling')"  block  
        Then  I  should  see  ".talk:contains('Specification')"  inside  ".personal-­‐schedule"  block  
        But  I  should  not  see  ".talk:contains('Modelling')"  inside  ".personal-­‐schedule"  block  
And what if you are that
rare example of a
stakeholder without A
clear understanding of
TCP/ip & HTML5?
Scenarios in declarative style
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  
        Given  there  is  a  conference  "Agile  Conference"  
        And  there  is  a  "Specification"  talk  in  the  first  time  period  
        When  I  choose  the  "Specification"  talk  
        Then  the  "Specification"  talk  should  be  in  my  personal  schedule  
    Scenario:  Failing  to  select  2  talks  into  the  same  time  period  
        Given  there  is  a  conference  "Agile  Conference"  
        And  there  is  a  "Specification"  talk  in  the  first  time  period  
        And  there  is  a  "Modelling"  talk  in  the  first  time  period  
        When  I  choose  the  "Specification"  talk  
        And  I  choose  the  "Modelling"  talk  
        Then  I  should  be  told  that  time  period  is  already  taken  by  another  talk  
How do you actually
call all these things?
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
Scenarios in ubiquitous language
Ubiquitous Language
“
– Eric Evans, Domain-Driven Design
A project faces serious problems when its
language is fractured. Domain experts use their
jargon while technical team members have their
own.
$
$ {}
$ {} bip
$ {}
Translation
bip
“
– Eric Evans, Domain-Driven Design
Translation blunts communication and makes
knowledge crunching anaemic.
$ {}
Translation
BDD
bip
$ $
Translation
BDD
bip
$ $
BDD
bip
$ $
Translation???
BDD
bip
$ $ {}
Translation???
BDD
{}
BDD DDD
Translation???
$ $
{$}
BDD DDD
Translation???
{$} {$}
{$}
BDD DDD
{$} {$}
Bdd vs DDD
BDD uses
Scenarios
“
– Eric Evans, Domain-Driven Design
To cross-check all these decisions, we have to
constantly step through scenarios to confirm that
we can solve application problems effectively.
“
– Eric Evans, Domain-Driven Design
To cross-check all these decisions, we have to
constantly step through scenarios to confirm that
we can solve application problems effectively.
DDD USES
Domain ModelS
“
– Eric Evans, Domain-Driven Design
A domain model is not a particular diagram; it is
the idea that the diagram is intended to convey.A
diagram can represent and communicate a model,
as can carefully written code, as can an English
sentence.
“
– Eric Evans, Domain-Driven Design
A domain model is not a particular diagram; it is
the idea that the diagram is intended to convey.A
diagram can represent and communicate a model,
as can carefully written code, as can an English
sentence.
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
Scenarios in ubiquitous language
“Pushing for ubiquitous language hard enough
makes your examples a domain model.
Modelling by Example
BDD as it was meant to be done
UI
Domain core
Objects
Outside-in
UI
Domain core
Objects
Outside-in
UI
Domain core
Objects
“
– Vaughn Vernon, Implementing Domain-Driven Design
The application boundary, or inner hexagon, is
also the use case (or user story) boundary. In
other words, we should create use cases based on
application functional requirements, not on the
number of diverse clients or output mechanisms.
Middle-out
UI
Domain core
Objects
UI
Domain core
Objects
Domain core
Objects
1. Remove the UI
Domain core
Objects
1. Remove the UI
2. Go through the domain
Domain core
Objects
UI
1. Remove the UI
2. Go through the domain
3. Add the UI back
Domain core
Objects
1. Remove the UI
2. Go through the domain
3. Add the UI back
4. Go through the UI
UI
Example Of an Example
used as a domain model
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
Conference Feature
Part 1: the Domain
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
Domain Layer / Scenario #1
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
Domain Layer / Scenario #1 / Step #1
class  AttendeeContext  implements  Context  {  
        ...  
        /**  
          *  @Given  a  conference  named  :name  with  :count  track(s)  
          */  
        public  function  aConferenceNamedWithTrack($name,  $count)  
        {  
                throw  new  PendingException();  
        }  
class  AttendeeContext  implements  Context  {  
        ...  
        /**  
          *  @Given  a  conference  named  :name  with  :count  track(s)  
          */  
        public  function  aConferenceNamedWithTrack($name,  $count)  
        {  
                $aConference  =  
        }  
class  AttendeeContext  implements  Context  {  
        ...  
        /**  
          *  @Given  a  conference  named  :name  with  :count  track(s)  
          */  
        public  function  aConferenceNamedWithTrack($name,  $count)  
        {  
                $aConference  =  Conference::namedWithTracks($name,  $count);  
        }  
Conference
+ namedWithTracks()  
conversation is your lead architect
Given  a  conference  named  "BDD  eXchange"  with  1  track
Given  a  conference  named  "BDD  eXchange"  
And  this  conference  is  planned  to  have  1  track
Conference
+ namedWithTracks()  
Conference
+ named()  
TrackPlanner
+ planTracks()  
+ howManyTracks()
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
Domain Layer / Scenario #1 / Step #2
class  AttendeeContext  implements  Context  {  
        ...  
        /**  
          *  @Given  the  :talk  talk  is  scheduled  for  :slot  slot  on  the  conference  track  :track  
          */  
        public  function  talkIsScheduledForSlotOnTrack($talk,  $slot,  $track)  
        {  
                throw  new  PendingException();  
        }  
class  AttendeeContext  implements  Context  {  
        ...  
        /**  
          *  @Given  the  :talk  talk  is  scheduled  for  :slot  slot  on  the  conference  track  :track  
          */  
        public  function  talkIsScheduledForSlotOnTrack($talk,  $slot,  $track)  
        {  
                $talk    =  Talk::named($talk);  
                $slot    =  Slot::fromString($slot);  
                $track  =  Track::numbered($track);  
        }
class  AttendeeContext  implements  Context  {  
        ...  
        /**  
          *  @Given  the  :talk  talk  is  scheduled  for  :slot  slot  on  the  conference  track  :track  
          */  
        public  function  talkIsScheduledForSlotOnTrack($talk,  $slot,  $track)  
        {  
                $talk    =  Talk::named($talk);  
                $slot    =  Slot::fromString($slot);  
                $track  =  Track::numbered($track);  
                $this-­‐>conference-­‐>scheduleTalk($talk,  $slot,  $track);  
        }  
Conference
+ namedWithTracks()  
+ scheduleTalk()
Talk
+  named()
Slot
+  fromString()
Track
+  numbered()
natural abstractions beat artificial ones
Bus
Car
<<interface>>  
Vehicle
Trip to work
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
Domain Layer / Scenario #1 / Step #3
class  AttendeeContext  implements  Context  {  
        ...  
        /**  
          *  @When  I  choose  the  :talk  talk  for  my  personal  schedule  of  this  conference  
          */  
        public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference(Talk  $talk)  
        {  
                $talk  =  Talk::named($talk);  
        }  
class  AttendeeContext  implements  Context  {  
        ...  
        /**  
          *  @When  I  choose  the  :talk  talk  for  my  personal  schedule  of  this  conference  
          */  
        public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference(Talk  $talk)  
        {  
                $talk  =  Talk::named($talk);  
                $mySchedule  =  PersonalSchedule::ofConference($this-­‐>conference);  
        }  
class  AttendeeContext  implements  Context  {  
        ...  
        /**  
          *  @When  I  choose  the  :talk  talk  for  my  personal  schedule  of  this  conference  
          */  
        public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference(Talk  $talk)  
        {  
                $talk  =  Talk::named($talk);  
                $mySchedule  =  PersonalSchedule::ofConference($this-­‐>conference);  
                $mySchedule-­‐>chooseTalk($talk);  
        }  
class  AttendeeContext  implements  Context  {  
        ...  
        /**  
          *  @When  I  choose  the  :talk  talk  for  my  personal  schedule  of  this  conference  
          */  
        public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference(Talk  $talk)  
        {  
                $talk  =  Talk::named($talk);  
                $this-­‐>schedule  =  PersonalSchedule::ofConference($this-­‐>conference);  
                $this-­‐>schedule-­‐>chooseTalk($talk);  
        }  
Conference
+ namedWithTracks()  
+ scheduleTalk()
Talk
+  named()
Slot
+  fromString()
Track
+  numbered()
PersonalSchedule
+ ofConference()  
+ chooseTalk()  
+ isTalkChosenForSlot()
It's ok to get it wrong
Conversation Understanding
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
Domain Layer / Scenario #1 / Step #4
class  AttendeeContext  implements  Context  {  
        ...  
        /**  
          *  @Then  the  chosen  talk  for  :slot  slot  should  be  the  :talk  
          */  
        public  function  theChosenTalkForSlotShouldBeThe(Slot  $slot,  Talk  $talk)  
        {  
                $talk  =  Talk::named($talk);  
                $slot  =  Slot::fromString($slot);  
        }  
class  AttendeeContext  implements  Context  {  
        ...  
        /**  
          *  @Then  the  chosen  talk  for  :slot  slot  should  be  the  :talk  
          */  
        public  function  theChosenTalkForSlotShouldBeThe(Slot  $slot,  Talk  $talk)  
        {  
                $talk  =  Talk::named($talk);  
                $slot  =  Slot::fromString($slot);  
                assertTrue($this-­‐>schedule-­‐>isTalkChosenForSlot($talk,  $slot));  
        }  
Conference
+ namedWithTracks()  
+ scheduleTalk()
Talk
+  named()
Slot
+  fromString()
Track
+  numbered()
PersonalSchedule
+ ofConference()  
+ chooseTalk()  
+ isTalkChosenForSlot()
Conference
+ namedWithTracks()  
+ scheduleTalk()
Talk
+  named()
Slot
+  fromString()
Track
+  numbered()
PersonalSchedule
+ ofConference()  
+ chooseTalk()  
+ isTalkChosenForSlot()
ScheduledTalk
+ isForTalk()  
+ isScheduledFor()  
+ hasSameSlotAs()
Planting Object-oriented software
Acceptance tests
Unit-tests
Domain core
Inner objects
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
Domain Layer / Scenario #1
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
Domain Layer / Scenario #2
Conference
+ namedWithTracks()  
+ scheduleTalk()
Talk
+  named()
Slot
+  fromString()
Track
+  numbered()
PersonalSchedule
+ ofConference()  
+ chooseTalk()  
+ isTalkChosenForSlot()
ScheduledTalk
+ isForTalk()  
+ isScheduledFor()  
+ hasSameSlotAs()
SlotIsAlreadyTaken
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
Domain Layer / Scenario #2
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
Domain Layer / both scenarios
Shorter stakeholder feedback loops
Domain
PERSISTENCE
UI
Days / weeks
Part 2: the UI
UI is a controller for the domain
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
Conference Feature
Scenario 1
Scenario 2
Scenario 3
Scenario 4
Scenario 5
Scenario 6
DOMAIN
☑
☑
☑
☑
☑
☑
Scenario 1
Scenario 2
Scenario 3
Scenario 4
Scenario 5
Scenario 6
DOMAIN UI
☑
☑
☑
☑
☑
☑
Scenario 1
Scenario 2
Scenario 3
Scenario 4
Scenario 5
Scenario 6
DOMAIN UI
☑
☑
☑
☑
☑
☑
Scenario 1
Scenario 2
Scenario 3
Scenario 4
Scenario 5
Scenario 6
DOMAIN UI
☑
☑
☑
☑
☑
☑
Scenario 1
Scenario 2
Scenario 3
Scenario 4
Scenario 5
Scenario 6
DOMAIN
☑
☑
UI
☑
☑
☑
☑
☑
☑
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
Conference Feature
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
Conference Feature critical paths
@critical
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
UI Layer / Scenario #1
@critical
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
UI Layer / Scenario #1 / Step #1
@critical
class  WebAttendeeContext  extends  WebBasedContext  {  
        ...  
        /**  
          *  @Given  a  conference  named  :name  with  :count  track(s)  
          */  
        public  function  aConferenceNamedWithTrack($name,  $count)  
        {  
                $this-­‐>conference  =  Conference::namedWithTracks($name,  $count);  
        }  
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
UI Layer / Scenario #1 / Step #2
@critical
class  WebAttendeeContext  extends  WebBasedContext  {  
        ...  
        /**  
          *  @Given  the  :talk  talk  is  scheduled  for  :slot  slot  on  the  conference  track  :track  
          */  
        public  function  talkIsScheduledForSlotOnTrack($talk,  $slot,  $track)  
        {  
                $talk    =  Talk::named($talk);  
                $slot    =  Slot::fromString($slot);  
                $track  =  Track::numbered($track);  
                $this-­‐>conference-­‐>scheduleTalk($talk,  $slot,  $track);  
        }  
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
UI Layer / Scenario #1 / Step #3
@critical
class  WebAttendeeContext  extends  WebBasedContext  {  
        ...  
        /**  
          *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference  
          */  
        public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)  
        {  
                throw  new  PendingException();  
        }  
class  WebAttendeeContext  extends  WebBasedContext  {  
        ...  
        /**  
          *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference  
          */  
        public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)  
        {  
                $this-­‐>visit('/conferences/'  .  urlencode($this-­‐>conference-­‐>getName()));  
        }  
class  WebAttendeeContext  extends  WebBasedContext  {  
        ...  
        /**  
          *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference  
          */  
        public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)  
        {  
                $this-­‐>visit('/conferences/'  .  urlencode($this-­‐>conference-­‐>getName()));  
                $talkElement  =  $this-­‐>find('css',  ".talk:contains('$name')");  
        }  
class  WebAttendeeContext  extends  WebBasedContext  {  
        ...  
        /**  
          *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference  
          */  
        public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)  
        {  
                $this-­‐>visit('/conferences/'  .  urlencode($this-­‐>conference-­‐>getName()));  
                $talkElement  =  $this-­‐>find('css',  ".talk:contains('$name')");  
                $talkElement-­‐>clickLink('Add  to  my  schedule');  
        }  
class  WebAttendeeContext  extends  WebBasedContext  {  
        ...  
        /**  
          *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference  
          */  
        public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)  
        {  
                $this-­‐>visit('/conferences/'  .  urlencode($this-­‐>conference-­‐>getName()));  
                $talkElement  =  $this-­‐>find('css',  ".talk:contains('$name')");  
                $talkElement-­‐>clickLink('Add  to  my  schedule');  
        }  
        ...  
        /**  
          *  @Given  a  conference  named  :name  with  :count  track(s)  
          */  
        public  function  aConferenceNamedWithTrack($name,  $count)  
        {  
                $this-­‐>conference  =  Conference::namedWithTracks($name,  $count);  
                //  persist  somehow?  
        }  
class  WebAttendeeContext  extends  WebBasedContext  {  
        ...  
        /**  
          *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference  
          */  
        public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)  
        {  
                $this-­‐>visit('/conferences/'  .  urlencode($this-­‐>conference-­‐>getName()));  
                $talkElement  =  $this-­‐>find('css',  ".talk:contains('$name')");  
                $talkElement-­‐>clickLink('Add  to  my  schedule');  
        }  
        ...  
        /**  
          *  @Given  a  conference  named  :name  with  :count  track(s)  
          */  
        public  function  aConferenceNamedWithTrack($name,  $count)  
        {  
                $this-­‐>conference  =  Conference::namedWithTracks($name,  $count);  
                $this-­‐>conferenceRepository-­‐>saveConference($this-­‐>conference);  
        }  
class  WebAttendeeContext  extends  WebBasedContext  {  
        ...  
        /**  
          *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference  
          */  
        public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)  
        {  
                $this-­‐>visit('/conferences/'  .  urlencode($this-­‐>conference-­‐>getName()));  
                $talkElement  =  $this-­‐>find('css',  ".talk:contains('$name')");  
                $talkElement-­‐>clickLink('Add  to  my  schedule');  
        }  
        ...  
        /**  
          *  @Given  a  conference  named  :name  with  :count  track(s)  
          */  
        public  function  aConferenceNamedWithTrack($name,  $count)  
        {  
                $this-­‐>conference  =  Conference::namedWithTracks($name,  $count);  
        }  
class  WebAttendeeContext  extends  WebBasedContext  {  
        ...  
        /**  
          *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference  
          */  
        public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)  
        {  
                $this-­‐>visit('/conferences/'  .  urlencode($this-­‐>conference-­‐>getName()));  
                $talkElement  =  $this-­‐>find('css',  ".talk:contains('$name')");  
                $talkElement-­‐>clickLink('Add  to  my  schedule');  
        }  
        ...  
        /**  
          *  @Given  a  conference  named  :name  with  :count  track(s)  was  planned  
          */  
        public  function  aConferenceNamedWithTrack($name,  $count)  
        {  
                $this-­‐>conference  =  Conference::namedWithTracks($name,  $count);  
        }
class  WebAttendeeContext  extends  WebBasedContext  {  
        ...  
        /**  
          *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference  
          */  
        public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)  
        {  
                $this-­‐>visit('/conferences/'  .  urlencode($this-­‐>conference-­‐>getName()));  
                $talkElement  =  $this-­‐>find('css',  ".talk:contains('$name')");  
                $talkElement-­‐>clickLink('Add  to  my  schedule');  
        }  
        ...  
        /**  
          *  @Given  a  conference  named  :name  with  :count  track(s)  was  planned  
          */  
        public  function  aConferenceNamedWithTrack($name,  $count)  
        {  
                $this-­‐>conference  =  Conference::namedWithTracks($name,  $count);  
                $this-­‐>conferencePlanner-­‐>planConference($this-­‐>conference);  
        }
Coevolving Scenarios & Application code
Scenarios App code
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
UI Layer / Scenario #1 / Step #4
@critical
class  WebAttendeeContext  extends  WebBasedContext  {  
        ...  
        /**  
          *  @Then  the  chosen  talk  for  :time  slot  should  be  the  :name  
          */  
        public  function  theChosenTalkForSlotShouldBeThe($name,  $time)  
        {  
                throw  new  PendingException();  
        }  
class  WebAttendeeContext  extends  WebBasedContext  {  
        ...  
        /**  
          *  @Then  the  chosen  talk  for  :time  slot  should  be  the  :name  
          */  
        public  function  theChosenTalkForSlotShouldBeThe($name,  $time)  
        {  
                $this-­‐>assertElementText('css',  ".my-­‐schedule  .talk:contains('$time')",  $name);  
        }  
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
UI Layer / Scenario #1
@critical
Infrastructure Leakage
Feature:  Attendee  selects  talks  to  attend  
    In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule  
    As  a  conference  attendee  
    I  want  to  create  my  personal  schedule  beforehand  
    Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot  
        Given  a  conference  named  "Agile  Conference"  with  1  track  
        And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"  
    Scenario:  Being  unable  to  select  2  talks  into  the  same  slot  
        Given  a  conference  named  "Agile  Conference"  with  2  tracks  
        And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1  
        And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2  
        When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference  
        And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference  
        Then  I  should  be  told  that  slot  is  already  taken  by  another  talk  
Both Layers / both scenarios
@critical
"Hey, it does work" Testing pyramid
Acceptance
tests
Unit Tests
UI TESTS 1 scenario
2 scenarios
7 unit-test cases
“
– David West, Object Thinking
Model the problem domain and
the solution will take care of itself.
“Focus on discussing business problems and
the architecture will emerge naturally.
Thanks to
MathiasVerraes @mathiasverraes
Dan North @tastapod
Ciaran McNulty @CiaranMcNulty
Aslak Hellesøy @aslak_hellesoy
Marcello Duarte @_md
INVIQA @inviqa
Thank you!
@everzet

More Related Content

What's hot

No drama here - E2E-testing django with playwright
No drama here - E2E-testing django with playwrightNo drama here - E2E-testing django with playwright
No drama here - E2E-testing django with playwrightMastacheata1
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean ArchitectureMattia Battiston
 
A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 Chris Richardson
 
Microservices Architectures: Become a Unicorn like Netflix, Twitter and Hailo
Microservices Architectures: Become a Unicorn like Netflix, Twitter and HailoMicroservices Architectures: Become a Unicorn like Netflix, Twitter and Hailo
Microservices Architectures: Become a Unicorn like Netflix, Twitter and Hailogjuljo
 
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...Chris Richardson
 
Refactoring page objects The Screenplay Pattern
Refactoring page objects   The Screenplay Pattern Refactoring page objects   The Screenplay Pattern
Refactoring page objects The Screenplay Pattern RiverGlide
 
Domain driven design and model driven development
Domain driven design and model driven developmentDomain driven design and model driven development
Domain driven design and model driven developmentDmitry Geyzersky
 
Beyond Hexagonal architecture
Beyond Hexagonal architectureBeyond Hexagonal architecture
Beyond Hexagonal architectureThomas Pierrain
 
Test Automation - Principles and Practices
Test Automation - Principles and PracticesTest Automation - Principles and Practices
Test Automation - Principles and PracticesAnand Bagmar
 
Clean architecture
Clean architectureClean architecture
Clean architectureLieven Doclo
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberKMS Technology
 
Browser Automation with Playwright – for integration, RPA, UI testing and mor...
Browser Automation with Playwright – for integration, RPA, UI testing and mor...Browser Automation with Playwright – for integration, RPA, UI testing and mor...
Browser Automation with Playwright – for integration, RPA, UI testing and mor...Lucas Jellema
 
An introduction to Behavior-Driven Development (BDD)
An introduction to Behavior-Driven Development (BDD)An introduction to Behavior-Driven Development (BDD)
An introduction to Behavior-Driven Development (BDD)Suman Guha
 
Code Coverage Revised : EclEmma on JaCoCo
Code Coverage Revised : EclEmma on JaCoCoCode Coverage Revised : EclEmma on JaCoCo
Code Coverage Revised : EclEmma on JaCoCoEvgeny Mandrikov
 
Fake It Outside-In TDD @XP2017
Fake It Outside-In TDD @XP2017Fake It Outside-In TDD @XP2017
Fake It Outside-In TDD @XP2017David Völkel
 
Railway Oriented Programming
Railway Oriented ProgrammingRailway Oriented Programming
Railway Oriented ProgrammingScott Wlaschin
 
How to Implement Domain Driven Design in Real Life SDLC
How to Implement Domain Driven Design  in Real Life SDLCHow to Implement Domain Driven Design  in Real Life SDLC
How to Implement Domain Driven Design in Real Life SDLCAbdul Karim
 
Front-End Testing: Demystified
Front-End Testing: DemystifiedFront-End Testing: Demystified
Front-End Testing: DemystifiedSeth McLaughlin
 

What's hot (20)

No drama here - E2E-testing django with playwright
No drama here - E2E-testing django with playwrightNo drama here - E2E-testing django with playwright
No drama here - E2E-testing django with playwright
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
 
A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 A pattern language for microservices - June 2021
A pattern language for microservices - June 2021
 
Microservices Architectures: Become a Unicorn like Netflix, Twitter and Hailo
Microservices Architectures: Become a Unicorn like Netflix, Twitter and HailoMicroservices Architectures: Become a Unicorn like Netflix, Twitter and Hailo
Microservices Architectures: Become a Unicorn like Netflix, Twitter and Hailo
 
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
 
Refactoring page objects The Screenplay Pattern
Refactoring page objects   The Screenplay Pattern Refactoring page objects   The Screenplay Pattern
Refactoring page objects The Screenplay Pattern
 
Domain driven design and model driven development
Domain driven design and model driven developmentDomain driven design and model driven development
Domain driven design and model driven development
 
Domain Driven Design
Domain Driven Design Domain Driven Design
Domain Driven Design
 
Beyond Hexagonal architecture
Beyond Hexagonal architectureBeyond Hexagonal architecture
Beyond Hexagonal architecture
 
Test Automation - Principles and Practices
Test Automation - Principles and PracticesTest Automation - Principles and Practices
Test Automation - Principles and Practices
 
Clean architecture
Clean architectureClean architecture
Clean architecture
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
 
Browser Automation with Playwright – for integration, RPA, UI testing and mor...
Browser Automation with Playwright – for integration, RPA, UI testing and mor...Browser Automation with Playwright – for integration, RPA, UI testing and mor...
Browser Automation with Playwright – for integration, RPA, UI testing and mor...
 
An introduction to Behavior-Driven Development (BDD)
An introduction to Behavior-Driven Development (BDD)An introduction to Behavior-Driven Development (BDD)
An introduction to Behavior-Driven Development (BDD)
 
Code Coverage Revised : EclEmma on JaCoCo
Code Coverage Revised : EclEmma on JaCoCoCode Coverage Revised : EclEmma on JaCoCo
Code Coverage Revised : EclEmma on JaCoCo
 
Fake It Outside-In TDD @XP2017
Fake It Outside-In TDD @XP2017Fake It Outside-In TDD @XP2017
Fake It Outside-In TDD @XP2017
 
Camunda BPM 7.13 Webinar
Camunda BPM 7.13 WebinarCamunda BPM 7.13 Webinar
Camunda BPM 7.13 Webinar
 
Railway Oriented Programming
Railway Oriented ProgrammingRailway Oriented Programming
Railway Oriented Programming
 
How to Implement Domain Driven Design in Real Life SDLC
How to Implement Domain Driven Design  in Real Life SDLCHow to Implement Domain Driven Design  in Real Life SDLC
How to Implement Domain Driven Design in Real Life SDLC
 
Front-End Testing: Demystified
Front-End Testing: DemystifiedFront-End Testing: Demystified
Front-End Testing: Demystified
 

Viewers also liked

Moving away from legacy code with BDD
Moving away from legacy code with BDDMoving away from legacy code with BDD
Moving away from legacy code with BDDKonstantin Kudryashov
 
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICKonstantin Kudryashov
 
Moving away from legacy code (AgileCymru)
Moving away from legacy code  (AgileCymru)Moving away from legacy code  (AgileCymru)
Moving away from legacy code (AgileCymru)Konstantin Kudryashov
 
Enabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsEnabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsKonstantin Kudryashov
 
Being effective with legacy projects
Being effective with legacy projectsBeing effective with legacy projects
Being effective with legacy projectsKonstantin Kudryashov
 
Bridging The Communication Gap, Fast
Bridging The Communication Gap, Fast Bridging The Communication Gap, Fast
Bridging The Communication Gap, Fast Konstantin Kudryashov
 
Moving away from legacy code with BDD
Moving away from legacy code with BDDMoving away from legacy code with BDD
Moving away from legacy code with BDDKonstantin Kudryashov
 
Design how your objects talk through mocking
Design how your objects talk through mockingDesign how your objects talk through mocking
Design how your objects talk through mockingKonstantin Kudryashov
 
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...Gáspár Nagy
 
Future-Proof Social Media (Boston State of Innovation 2015)
Future-Proof Social Media (Boston State of Innovation 2015)Future-Proof Social Media (Boston State of Innovation 2015)
Future-Proof Social Media (Boston State of Innovation 2015)Steph Parker
 
A Brief Intro to Logo Design
A Brief Intro to Logo DesignA Brief Intro to Logo Design
A Brief Intro to Logo DesignChris Edwards
 
Social Media Strategies Summit: Higher Education 2015
Social Media Strategies Summit: Higher Education 2015Social Media Strategies Summit: Higher Education 2015
Social Media Strategies Summit: Higher Education 2015Steph Parker
 
Brand matters: Anatomy of a successful B2B Brand Communications Plan
Brand matters: Anatomy of a successful B2B Brand Communications PlanBrand matters: Anatomy of a successful B2B Brand Communications Plan
Brand matters: Anatomy of a successful B2B Brand Communications PlanDelia Associates
 
Anatomy of an email pitch
Anatomy of an email pitchAnatomy of an email pitch
Anatomy of an email pitchPrezly
 

Viewers also liked (20)

Modern Agile Project Toolbox
Modern Agile Project ToolboxModern Agile Project Toolbox
Modern Agile Project Toolbox
 
Min-Maxing Software Costs
Min-Maxing Software CostsMin-Maxing Software Costs
Min-Maxing Software Costs
 
Moving away from legacy code with BDD
Moving away from legacy code with BDDMoving away from legacy code with BDD
Moving away from legacy code with BDD
 
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DIC
 
Moving away from legacy code (AgileCymru)
Moving away from legacy code  (AgileCymru)Moving away from legacy code  (AgileCymru)
Moving away from legacy code (AgileCymru)
 
BDD by example
BDD by exampleBDD by example
BDD by example
 
Enabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsEnabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projects
 
Modern Project Toolbox
Modern Project ToolboxModern Project Toolbox
Modern Project Toolbox
 
Being effective with legacy projects
Being effective with legacy projectsBeing effective with legacy projects
Being effective with legacy projects
 
BDD в PHP с Behat и Mink
BDD в PHP с Behat и MinkBDD в PHP с Behat и Mink
BDD в PHP с Behat и Mink
 
BDD для PHP проектов
BDD для PHP проектовBDD для PHP проектов
BDD для PHP проектов
 
Bridging The Communication Gap, Fast
Bridging The Communication Gap, Fast Bridging The Communication Gap, Fast
Bridging The Communication Gap, Fast
 
Moving away from legacy code with BDD
Moving away from legacy code with BDDMoving away from legacy code with BDD
Moving away from legacy code with BDD
 
Design how your objects talk through mocking
Design how your objects talk through mockingDesign how your objects talk through mocking
Design how your objects talk through mocking
 
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
 
Future-Proof Social Media (Boston State of Innovation 2015)
Future-Proof Social Media (Boston State of Innovation 2015)Future-Proof Social Media (Boston State of Innovation 2015)
Future-Proof Social Media (Boston State of Innovation 2015)
 
A Brief Intro to Logo Design
A Brief Intro to Logo DesignA Brief Intro to Logo Design
A Brief Intro to Logo Design
 
Social Media Strategies Summit: Higher Education 2015
Social Media Strategies Summit: Higher Education 2015Social Media Strategies Summit: Higher Education 2015
Social Media Strategies Summit: Higher Education 2015
 
Brand matters: Anatomy of a successful B2B Brand Communications Plan
Brand matters: Anatomy of a successful B2B Brand Communications PlanBrand matters: Anatomy of a successful B2B Brand Communications Plan
Brand matters: Anatomy of a successful B2B Brand Communications Plan
 
Anatomy of an email pitch
Anatomy of an email pitchAnatomy of an email pitch
Anatomy of an email pitch
 

Similar to Taking back BDD

Adobe Connect StoryBoard
Adobe Connect StoryBoardAdobe Connect StoryBoard
Adobe Connect StoryBoardMelinda Schmidt
 
Behaviour-Driven Development for Conversational Applications
Behaviour-Driven Development for Conversational ApplicationsBehaviour-Driven Development for Conversational Applications
Behaviour-Driven Development for Conversational ApplicationsFlorian Georg
 
User centered design workshop
User centered design workshopUser centered design workshop
User centered design workshopPatrick McNeil
 
Engl317 project1 slidedoc5_howto_composethepodcast
Engl317 project1 slidedoc5_howto_composethepodcastEngl317 project1 slidedoc5_howto_composethepodcast
Engl317 project1 slidedoc5_howto_composethepodcastZachary Williamson
 
Fine tune and deploy Hugging Face NLP models
Fine tune and deploy Hugging Face NLP modelsFine tune and deploy Hugging Face NLP models
Fine tune and deploy Hugging Face NLP modelsOVHcloud
 
How to create a management consulting presentation
How to create a management consulting presentationHow to create a management consulting presentation
How to create a management consulting presentationAsen Gyczew
 
CS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionCS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionEelco Visser
 
Basic Engineering Design (Part 7): Presenting the Solution
Basic Engineering Design (Part 7): Presenting the SolutionBasic Engineering Design (Part 7): Presenting the Solution
Basic Engineering Design (Part 7): Presenting the SolutionDenise Wilson
 
Functional Thinking Paradigm Over Syntax.pdf
Functional Thinking Paradigm Over Syntax.pdfFunctional Thinking Paradigm Over Syntax.pdf
Functional Thinking Paradigm Over Syntax.pdfDouglas Fernandes
 
Storytelling for research software engineers
Storytelling for research software engineersStorytelling for research software engineers
Storytelling for research software engineersAlbanLevy
 
A complete weed control guide
A complete weed control guideA complete weed control guide
A complete weed control guidelawnscanner
 
(E book pdf) thinking in patterns with java
(E book   pdf) thinking in patterns with java(E book   pdf) thinking in patterns with java
(E book pdf) thinking in patterns with javaRaffaella D'angelo
 
Creating a compiler for your own language
Creating a compiler for your own languageCreating a compiler for your own language
Creating a compiler for your own languageAndrea Tino
 
Build your own Language - Why and How?
Build your own Language - Why and How?Build your own Language - Why and How?
Build your own Language - Why and How?Markus Voelter
 
From Specification To Success
From Specification To SuccessFrom Specification To Success
From Specification To SuccessPatchSpace Ltd
 
The New Lisbon University - SDL Open Exchange 2015
The New Lisbon University -  SDL Open Exchange 2015The New Lisbon University -  SDL Open Exchange 2015
The New Lisbon University - SDL Open Exchange 2015Paul Filkin
 

Similar to Taking back BDD (20)

Adobe Connect StoryBoard
Adobe Connect StoryBoardAdobe Connect StoryBoard
Adobe Connect StoryBoard
 
Give A Great Tech Talk 2013
Give A Great Tech Talk 2013Give A Great Tech Talk 2013
Give A Great Tech Talk 2013
 
BDD & Cucumber
BDD & CucumberBDD & Cucumber
BDD & Cucumber
 
Behaviour-Driven Development for Conversational Applications
Behaviour-Driven Development for Conversational ApplicationsBehaviour-Driven Development for Conversational Applications
Behaviour-Driven Development for Conversational Applications
 
User centered design workshop
User centered design workshopUser centered design workshop
User centered design workshop
 
Engl317 project1 slidedoc5_howto_composethepodcast
Engl317 project1 slidedoc5_howto_composethepodcastEngl317 project1 slidedoc5_howto_composethepodcast
Engl317 project1 slidedoc5_howto_composethepodcast
 
Fine tune and deploy Hugging Face NLP models
Fine tune and deploy Hugging Face NLP modelsFine tune and deploy Hugging Face NLP models
Fine tune and deploy Hugging Face NLP models
 
Python overview
Python overviewPython overview
Python overview
 
How to create a management consulting presentation
How to create a management consulting presentationHow to create a management consulting presentation
How to create a management consulting presentation
 
CS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionCS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: Introduction
 
Basic Engineering Design (Part 7): Presenting the Solution
Basic Engineering Design (Part 7): Presenting the SolutionBasic Engineering Design (Part 7): Presenting the Solution
Basic Engineering Design (Part 7): Presenting the Solution
 
Functional Thinking Paradigm Over Syntax.pdf
Functional Thinking Paradigm Over Syntax.pdfFunctional Thinking Paradigm Over Syntax.pdf
Functional Thinking Paradigm Over Syntax.pdf
 
BDD, Behat & Drupal
BDD, Behat & DrupalBDD, Behat & Drupal
BDD, Behat & Drupal
 
Storytelling for research software engineers
Storytelling for research software engineersStorytelling for research software engineers
Storytelling for research software engineers
 
A complete weed control guide
A complete weed control guideA complete weed control guide
A complete weed control guide
 
(E book pdf) thinking in patterns with java
(E book   pdf) thinking in patterns with java(E book   pdf) thinking in patterns with java
(E book pdf) thinking in patterns with java
 
Creating a compiler for your own language
Creating a compiler for your own languageCreating a compiler for your own language
Creating a compiler for your own language
 
Build your own Language - Why and How?
Build your own Language - Why and How?Build your own Language - Why and How?
Build your own Language - Why and How?
 
From Specification To Success
From Specification To SuccessFrom Specification To Success
From Specification To Success
 
The New Lisbon University - SDL Open Exchange 2015
The New Lisbon University -  SDL Open Exchange 2015The New Lisbon University -  SDL Open Exchange 2015
The New Lisbon University - SDL Open Exchange 2015
 

Recently uploaded

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 

Recently uploaded (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

Taking back BDD

  • 1. Konstantin K. @everzet Taking back Behaviour Driven Development
  • 2.
  • 3. The User-story    In  order  to  spend  more  time  socialising  at  the  conference      instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand  
  • 5. Can you give me an example of how you would do it?
  • 6. Scenarios in imperative style Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk          Given  there  is  a  conference  "XP  Conference"          And  there  is  a  "Specification"  talk  in  first  time  period          When  I  open  the  "/conferences/xp"  page          And  I  click  "Add  to  my  schedule"  inside  ".talk:contains('Specification')"  block          Then  I  should  see  ".talk:contains('Specification')"  inside  ".personal-­‐schedule"  block      Scenario:  Failing  to  select  2  talks  into  the  time  period          Given  there  is  a  conference  "XP  Conference"          And  there  is  a  "Specification"  talk  in  the  first  time  period          And  there  is  a  "Modelling"  talk  in  the  first  time  period          When  I  open  the  "/conferences/xp"  page          And  I  click  "Add  to  my  schedule"  inside  ".talk:contains('Specification')"  block          And  I  click  "Add  to  my  schedule"  inside  ".talk:contains('Modelling')"  block          Then  I  should  see  ".talk:contains('Specification')"  inside  ".personal-­‐schedule"  block          But  I  should  not  see  ".talk:contains('Modelling')"  inside  ".personal-­‐schedule"  block  
  • 7. And what if you are that rare example of a stakeholder without A clear understanding of TCP/ip & HTML5?
  • 8. Scenarios in declarative style Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk          Given  there  is  a  conference  "Agile  Conference"          And  there  is  a  "Specification"  talk  in  the  first  time  period          When  I  choose  the  "Specification"  talk          Then  the  "Specification"  talk  should  be  in  my  personal  schedule      Scenario:  Failing  to  select  2  talks  into  the  same  time  period          Given  there  is  a  conference  "Agile  Conference"          And  there  is  a  "Specification"  talk  in  the  first  time  period          And  there  is  a  "Modelling"  talk  in  the  first  time  period          When  I  choose  the  "Specification"  talk          And  I  choose  the  "Modelling"  talk          Then  I  should  be  told  that  time  period  is  already  taken  by  another  talk  
  • 9. How do you actually call all these things?
  • 10. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   Scenarios in ubiquitous language
  • 12. “ – Eric Evans, Domain-Driven Design A project faces serious problems when its language is fractured. Domain experts use their jargon while technical team members have their own.
  • 13. $
  • 14. $ {}
  • 17. “ – Eric Evans, Domain-Driven Design Translation blunts communication and makes knowledge crunching anaemic.
  • 28. “ – Eric Evans, Domain-Driven Design To cross-check all these decisions, we have to constantly step through scenarios to confirm that we can solve application problems effectively.
  • 29. “ – Eric Evans, Domain-Driven Design To cross-check all these decisions, we have to constantly step through scenarios to confirm that we can solve application problems effectively.
  • 31. “ – Eric Evans, Domain-Driven Design A domain model is not a particular diagram; it is the idea that the diagram is intended to convey.A diagram can represent and communicate a model, as can carefully written code, as can an English sentence.
  • 32. “ – Eric Evans, Domain-Driven Design A domain model is not a particular diagram; it is the idea that the diagram is intended to convey.A diagram can represent and communicate a model, as can carefully written code, as can an English sentence.
  • 33. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   Scenarios in ubiquitous language
  • 34. “Pushing for ubiquitous language hard enough makes your examples a domain model.
  • 35. Modelling by Example BDD as it was meant to be done
  • 39. “ – Vaughn Vernon, Implementing Domain-Driven Design The application boundary, or inner hexagon, is also the use case (or user story) boundary. In other words, we should create use cases based on application functional requirements, not on the number of diverse clients or output mechanisms.
  • 43. Domain core Objects 1. Remove the UI 2. Go through the domain
  • 44. Domain core Objects UI 1. Remove the UI 2. Go through the domain 3. Add the UI back
  • 45. Domain core Objects 1. Remove the UI 2. Go through the domain 3. Add the UI back 4. Go through the UI UI
  • 46. Example Of an Example used as a domain model
  • 47. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   Conference Feature
  • 48. Part 1: the Domain
  • 49. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   Domain Layer / Scenario #1
  • 50. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   Domain Layer / Scenario #1 / Step #1
  • 51. class  AttendeeContext  implements  Context  {          ...          /**            *  @Given  a  conference  named  :name  with  :count  track(s)            */          public  function  aConferenceNamedWithTrack($name,  $count)          {                  throw  new  PendingException();          }  
  • 52. class  AttendeeContext  implements  Context  {          ...          /**            *  @Given  a  conference  named  :name  with  :count  track(s)            */          public  function  aConferenceNamedWithTrack($name,  $count)          {                  $aConference  =          }  
  • 53. class  AttendeeContext  implements  Context  {          ...          /**            *  @Given  a  conference  named  :name  with  :count  track(s)            */          public  function  aConferenceNamedWithTrack($name,  $count)          {                  $aConference  =  Conference::namedWithTracks($name,  $count);          }  
  • 55. conversation is your lead architect Given  a  conference  named  "BDD  eXchange"  with  1  track Given  a  conference  named  "BDD  eXchange"   And  this  conference  is  planned  to  have  1  track Conference + namedWithTracks()   Conference + named()   TrackPlanner + planTracks()   + howManyTracks()
  • 56. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   Domain Layer / Scenario #1 / Step #2
  • 57. class  AttendeeContext  implements  Context  {          ...          /**            *  @Given  the  :talk  talk  is  scheduled  for  :slot  slot  on  the  conference  track  :track            */          public  function  talkIsScheduledForSlotOnTrack($talk,  $slot,  $track)          {                  throw  new  PendingException();          }  
  • 58. class  AttendeeContext  implements  Context  {          ...          /**            *  @Given  the  :talk  talk  is  scheduled  for  :slot  slot  on  the  conference  track  :track            */          public  function  talkIsScheduledForSlotOnTrack($talk,  $slot,  $track)          {                  $talk    =  Talk::named($talk);                  $slot    =  Slot::fromString($slot);                  $track  =  Track::numbered($track);          }
  • 59. class  AttendeeContext  implements  Context  {          ...          /**            *  @Given  the  :talk  talk  is  scheduled  for  :slot  slot  on  the  conference  track  :track            */          public  function  talkIsScheduledForSlotOnTrack($talk,  $slot,  $track)          {                  $talk    =  Talk::named($talk);                  $slot    =  Slot::fromString($slot);                  $track  =  Track::numbered($track);                  $this-­‐>conference-­‐>scheduleTalk($talk,  $slot,  $track);          }  
  • 60. Conference + namedWithTracks()   + scheduleTalk() Talk +  named() Slot +  fromString() Track +  numbered()
  • 61. natural abstractions beat artificial ones Bus Car <<interface>>   Vehicle Trip to work
  • 62. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   Domain Layer / Scenario #1 / Step #3
  • 63. class  AttendeeContext  implements  Context  {          ...          /**            *  @When  I  choose  the  :talk  talk  for  my  personal  schedule  of  this  conference            */          public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference(Talk  $talk)          {                  $talk  =  Talk::named($talk);          }  
  • 64. class  AttendeeContext  implements  Context  {          ...          /**            *  @When  I  choose  the  :talk  talk  for  my  personal  schedule  of  this  conference            */          public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference(Talk  $talk)          {                  $talk  =  Talk::named($talk);                  $mySchedule  =  PersonalSchedule::ofConference($this-­‐>conference);          }  
  • 65. class  AttendeeContext  implements  Context  {          ...          /**            *  @When  I  choose  the  :talk  talk  for  my  personal  schedule  of  this  conference            */          public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference(Talk  $talk)          {                  $talk  =  Talk::named($talk);                  $mySchedule  =  PersonalSchedule::ofConference($this-­‐>conference);                  $mySchedule-­‐>chooseTalk($talk);          }  
  • 66. class  AttendeeContext  implements  Context  {          ...          /**            *  @When  I  choose  the  :talk  talk  for  my  personal  schedule  of  this  conference            */          public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference(Talk  $talk)          {                  $talk  =  Talk::named($talk);                  $this-­‐>schedule  =  PersonalSchedule::ofConference($this-­‐>conference);                  $this-­‐>schedule-­‐>chooseTalk($talk);          }  
  • 67. Conference + namedWithTracks()   + scheduleTalk() Talk +  named() Slot +  fromString() Track +  numbered() PersonalSchedule + ofConference()   + chooseTalk()   + isTalkChosenForSlot()
  • 68. It's ok to get it wrong Conversation Understanding
  • 69. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   Domain Layer / Scenario #1 / Step #4
  • 70. class  AttendeeContext  implements  Context  {          ...          /**            *  @Then  the  chosen  talk  for  :slot  slot  should  be  the  :talk            */          public  function  theChosenTalkForSlotShouldBeThe(Slot  $slot,  Talk  $talk)          {                  $talk  =  Talk::named($talk);                  $slot  =  Slot::fromString($slot);          }  
  • 71. class  AttendeeContext  implements  Context  {          ...          /**            *  @Then  the  chosen  talk  for  :slot  slot  should  be  the  :talk            */          public  function  theChosenTalkForSlotShouldBeThe(Slot  $slot,  Talk  $talk)          {                  $talk  =  Talk::named($talk);                  $slot  =  Slot::fromString($slot);                  assertTrue($this-­‐>schedule-­‐>isTalkChosenForSlot($talk,  $slot));          }  
  • 72. Conference + namedWithTracks()   + scheduleTalk() Talk +  named() Slot +  fromString() Track +  numbered() PersonalSchedule + ofConference()   + chooseTalk()   + isTalkChosenForSlot()
  • 73. Conference + namedWithTracks()   + scheduleTalk() Talk +  named() Slot +  fromString() Track +  numbered() PersonalSchedule + ofConference()   + chooseTalk()   + isTalkChosenForSlot() ScheduledTalk + isForTalk()   + isScheduledFor()   + hasSameSlotAs()
  • 74. Planting Object-oriented software Acceptance tests Unit-tests Domain core Inner objects
  • 75. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   Domain Layer / Scenario #1
  • 76. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   Domain Layer / Scenario #2
  • 77. Conference + namedWithTracks()   + scheduleTalk() Talk +  named() Slot +  fromString() Track +  numbered() PersonalSchedule + ofConference()   + chooseTalk()   + isTalkChosenForSlot() ScheduledTalk + isForTalk()   + isScheduledFor()   + hasSameSlotAs() SlotIsAlreadyTaken
  • 78. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   Domain Layer / Scenario #2
  • 79. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   Domain Layer / both scenarios
  • 80. Shorter stakeholder feedback loops Domain PERSISTENCE UI Days / weeks
  • 82. UI is a controller for the domain
  • 83. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   Conference Feature
  • 84. Scenario 1 Scenario 2 Scenario 3 Scenario 4 Scenario 5 Scenario 6 DOMAIN ☑ ☑ ☑ ☑ ☑ ☑
  • 85. Scenario 1 Scenario 2 Scenario 3 Scenario 4 Scenario 5 Scenario 6 DOMAIN UI ☑ ☑ ☑ ☑ ☑ ☑
  • 86. Scenario 1 Scenario 2 Scenario 3 Scenario 4 Scenario 5 Scenario 6 DOMAIN UI ☑ ☑ ☑ ☑ ☑ ☑
  • 87. Scenario 1 Scenario 2 Scenario 3 Scenario 4 Scenario 5 Scenario 6 DOMAIN UI ☑ ☑ ☑ ☑ ☑ ☑
  • 88. Scenario 1 Scenario 2 Scenario 3 Scenario 4 Scenario 5 Scenario 6 DOMAIN ☑ ☑ UI ☑ ☑ ☑ ☑ ☑ ☑
  • 89. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   Conference Feature
  • 90. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   Conference Feature critical paths @critical
  • 91. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   UI Layer / Scenario #1 @critical
  • 92. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   UI Layer / Scenario #1 / Step #1 @critical
  • 93. class  WebAttendeeContext  extends  WebBasedContext  {          ...          /**            *  @Given  a  conference  named  :name  with  :count  track(s)            */          public  function  aConferenceNamedWithTrack($name,  $count)          {                  $this-­‐>conference  =  Conference::namedWithTracks($name,  $count);          }  
  • 94. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   UI Layer / Scenario #1 / Step #2 @critical
  • 95. class  WebAttendeeContext  extends  WebBasedContext  {          ...          /**            *  @Given  the  :talk  talk  is  scheduled  for  :slot  slot  on  the  conference  track  :track            */          public  function  talkIsScheduledForSlotOnTrack($talk,  $slot,  $track)          {                  $talk    =  Talk::named($talk);                  $slot    =  Slot::fromString($slot);                  $track  =  Track::numbered($track);                  $this-­‐>conference-­‐>scheduleTalk($talk,  $slot,  $track);          }  
  • 96. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   UI Layer / Scenario #1 / Step #3 @critical
  • 97. class  WebAttendeeContext  extends  WebBasedContext  {          ...          /**            *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference            */          public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)          {                  throw  new  PendingException();          }  
  • 98. class  WebAttendeeContext  extends  WebBasedContext  {          ...          /**            *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference            */          public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)          {                  $this-­‐>visit('/conferences/'  .  urlencode($this-­‐>conference-­‐>getName()));          }  
  • 99. class  WebAttendeeContext  extends  WebBasedContext  {          ...          /**            *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference            */          public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)          {                  $this-­‐>visit('/conferences/'  .  urlencode($this-­‐>conference-­‐>getName()));                  $talkElement  =  $this-­‐>find('css',  ".talk:contains('$name')");          }  
  • 100. class  WebAttendeeContext  extends  WebBasedContext  {          ...          /**            *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference            */          public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)          {                  $this-­‐>visit('/conferences/'  .  urlencode($this-­‐>conference-­‐>getName()));                  $talkElement  =  $this-­‐>find('css',  ".talk:contains('$name')");                  $talkElement-­‐>clickLink('Add  to  my  schedule');          }  
  • 101. class  WebAttendeeContext  extends  WebBasedContext  {          ...          /**            *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference            */          public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)          {                  $this-­‐>visit('/conferences/'  .  urlencode($this-­‐>conference-­‐>getName()));                  $talkElement  =  $this-­‐>find('css',  ".talk:contains('$name')");                  $talkElement-­‐>clickLink('Add  to  my  schedule');          }          ...          /**            *  @Given  a  conference  named  :name  with  :count  track(s)            */          public  function  aConferenceNamedWithTrack($name,  $count)          {                  $this-­‐>conference  =  Conference::namedWithTracks($name,  $count);                  //  persist  somehow?          }  
  • 102. class  WebAttendeeContext  extends  WebBasedContext  {          ...          /**            *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference            */          public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)          {                  $this-­‐>visit('/conferences/'  .  urlencode($this-­‐>conference-­‐>getName()));                  $talkElement  =  $this-­‐>find('css',  ".talk:contains('$name')");                  $talkElement-­‐>clickLink('Add  to  my  schedule');          }          ...          /**            *  @Given  a  conference  named  :name  with  :count  track(s)            */          public  function  aConferenceNamedWithTrack($name,  $count)          {                  $this-­‐>conference  =  Conference::namedWithTracks($name,  $count);                  $this-­‐>conferenceRepository-­‐>saveConference($this-­‐>conference);          }  
  • 103. class  WebAttendeeContext  extends  WebBasedContext  {          ...          /**            *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference            */          public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)          {                  $this-­‐>visit('/conferences/'  .  urlencode($this-­‐>conference-­‐>getName()));                  $talkElement  =  $this-­‐>find('css',  ".talk:contains('$name')");                  $talkElement-­‐>clickLink('Add  to  my  schedule');          }          ...          /**            *  @Given  a  conference  named  :name  with  :count  track(s)            */          public  function  aConferenceNamedWithTrack($name,  $count)          {                  $this-­‐>conference  =  Conference::namedWithTracks($name,  $count);          }  
  • 104. class  WebAttendeeContext  extends  WebBasedContext  {          ...          /**            *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference            */          public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)          {                  $this-­‐>visit('/conferences/'  .  urlencode($this-­‐>conference-­‐>getName()));                  $talkElement  =  $this-­‐>find('css',  ".talk:contains('$name')");                  $talkElement-­‐>clickLink('Add  to  my  schedule');          }          ...          /**            *  @Given  a  conference  named  :name  with  :count  track(s)  was  planned            */          public  function  aConferenceNamedWithTrack($name,  $count)          {                  $this-­‐>conference  =  Conference::namedWithTracks($name,  $count);          }
  • 105. class  WebAttendeeContext  extends  WebBasedContext  {          ...          /**            *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference            */          public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)          {                  $this-­‐>visit('/conferences/'  .  urlencode($this-­‐>conference-­‐>getName()));                  $talkElement  =  $this-­‐>find('css',  ".talk:contains('$name')");                  $talkElement-­‐>clickLink('Add  to  my  schedule');          }          ...          /**            *  @Given  a  conference  named  :name  with  :count  track(s)  was  planned            */          public  function  aConferenceNamedWithTrack($name,  $count)          {                  $this-­‐>conference  =  Conference::namedWithTracks($name,  $count);                  $this-­‐>conferencePlanner-­‐>planConference($this-­‐>conference);          }
  • 106. Coevolving Scenarios & Application code Scenarios App code
  • 107. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   UI Layer / Scenario #1 / Step #4 @critical
  • 108. class  WebAttendeeContext  extends  WebBasedContext  {          ...          /**            *  @Then  the  chosen  talk  for  :time  slot  should  be  the  :name            */          public  function  theChosenTalkForSlotShouldBeThe($name,  $time)          {                  throw  new  PendingException();          }  
  • 109. class  WebAttendeeContext  extends  WebBasedContext  {          ...          /**            *  @Then  the  chosen  talk  for  :time  slot  should  be  the  :name            */          public  function  theChosenTalkForSlotShouldBeThe($name,  $time)          {                  $this-­‐>assertElementText('css',  ".my-­‐schedule  .talk:contains('$time')",  $name);          }  
  • 110. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   UI Layer / Scenario #1 @critical
  • 112. Feature:  Attendee  selects  talks  to  attend      In  order  to  spend  more  time  socialising  at  the  conference  instead  of  looking  at  the  schedule      As  a  conference  attendee      I  want  to  create  my  personal  schedule  beforehand      Scenario:  Successfully  selecting  1  talk  from  the  1  track  conference  for  a  single  slot          Given  a  conference  named  "Agile  Conference"  with  1  track          And  the  "Specification"  talk  is  scheduled  for  "10:30-­‐11:30"  slot  on  the  conference  track  1          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          Then  the  chosen  talk  for  "10:30-­‐11:30"  slot  of  my  schedule  should  be  the  "Specification"      Scenario:  Being  unable  to  select  2  talks  into  the  same  slot          Given  a  conference  named  "Agile  Conference"  with  2  tracks          And  the  "Specification"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  1          And  the  "Modelling"  talk  is  scheduled  for  "09:00-­‐09:45"  slot  on  the  conference  track  2          When  I  choose  the  "Specification"  talk  for  my  personal  schedule  of  this  conference          And  I  try  to  choose  the  "Modelling"  talk  for  my  personal  schedule  of  this  conference          Then  I  should  be  told  that  slot  is  already  taken  by  another  talk   Both Layers / both scenarios @critical
  • 113. "Hey, it does work" Testing pyramid Acceptance tests Unit Tests UI TESTS 1 scenario 2 scenarios 7 unit-test cases
  • 114. “ – David West, Object Thinking Model the problem domain and the solution will take care of itself.
  • 115. “Focus on discussing business problems and the architecture will emerge naturally.
  • 116. Thanks to MathiasVerraes @mathiasverraes Dan North @tastapod Ciaran McNulty @CiaranMcNulty Aslak Hellesøy @aslak_hellesoy Marcello Duarte @_md INVIQA @inviqa