Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Taking back BDD

3,204 views

Published on

Behaviour Driven Development (BDD) and Domain Driven Design (DDD) seen a great growth in adoption in recent years. We are all creating new practices and tools that try and bring these two very important modern methodologies together. What if we have it backwards and they were actually together all along? What if most of the misunderstandings and challenges we face in implementing BDD are spawned from the very simple mistake of us separating something that was created as a whole? In this talk we'll delve into BDD as it was meant to be done from the beginning and look at its very rooted connection with the software design.

Published in: Technology

Taking back BDD

  1. 1. Konstantin K. @everzet Taking back Behaviour Driven Development
  2. 2. 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  
  3. 3. What is BDD?
  4. 4. Can you give me an example of how you would do it?
  5. 5. 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  
  6. 6. And what if you are that rare example of a stakeholder without A clear understanding of TCP/ip & HTML5?
  7. 7. 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  
  8. 8. How do you actually call all these things?
  9. 9. 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
  10. 10. Ubiquitous Language
  11. 11. “ – 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.
  12. 12. $
  13. 13. $ {}
  14. 14. $ {} bip
  15. 15. $ {} Translation bip
  16. 16. “ – Eric Evans, Domain-Driven Design Translation blunts communication and makes knowledge crunching anaemic.
  17. 17. $ {} Translation BDD bip
  18. 18. $ $ Translation BDD bip
  19. 19. $ $ BDD bip
  20. 20. $ $ Translation??? BDD bip
  21. 21. $ $ {} Translation??? BDD
  22. 22. {} BDD DDD Translation??? $ $
  23. 23. {$} BDD DDD Translation??? {$} {$}
  24. 24. {$} BDD DDD {$} {$}
  25. 25. Bdd vs DDD
  26. 26. BDD uses Scenarios
  27. 27. “ – 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.
  28. 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. 29. DDD USES Domain ModelS
  30. 30. “ – 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.
  31. 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. 32. 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
  33. 33. “Pushing for ubiquitous language hard enough makes your examples a domain model.
  34. 34. Modelling by Example BDD as it was meant to be done
  35. 35. UI Domain core Objects
  36. 36. Outside-in UI Domain core Objects
  37. 37. Outside-in UI Domain core Objects
  38. 38. “ – 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.
  39. 39. Middle-out UI Domain core Objects
  40. 40. UI Domain core Objects
  41. 41. Domain core Objects 1. Remove the UI
  42. 42. Domain core Objects 1. Remove the UI 2. Go through the domain
  43. 43. Domain core Objects UI 1. Remove the UI 2. Go through the domain 3. Add the UI back
  44. 44. Domain core Objects 1. Remove the UI 2. Go through the domain 3. Add the UI back 4. Go through the UI UI
  45. 45. Example Of an Example used as a domain model
  46. 46. 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
  47. 47. Part 1: the Domain
  48. 48. 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
  49. 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 / Step #1
  50. 50. class  AttendeeContext  implements  Context  {          ...          /**            *  @Given  a  conference  named  :name  with  :count  track(s)            */          public  function  aConferenceNamedWithTrack($name,  $count)          {                  throw  new  PendingException();          }  
  51. 51. class  AttendeeContext  implements  Context  {          ...          /**            *  @Given  a  conference  named  :name  with  :count  track(s)            */          public  function  aConferenceNamedWithTrack($name,  $count)          {                  $aConference  =          }  
  52. 52. class  AttendeeContext  implements  Context  {          ...          /**            *  @Given  a  conference  named  :name  with  :count  track(s)            */          public  function  aConferenceNamedWithTrack($name,  $count)          {                  $aConference  =  Conference::namedWithTracks($name,  $count);          }  
  53. 53. Conference + namedWithTracks()  
  54. 54. 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()
  55. 55. 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
  56. 56. 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();          }  
  57. 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)          {                  $talk    =  Talk::named($talk);                  $slot    =  Slot::fromString($slot);                  $track  =  Track::numbered($track);          }
  58. 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);                  $this-­‐>conference-­‐>scheduleTalk($talk,  $slot,  $track);          }  
  59. 59. Conference + namedWithTracks()   + scheduleTalk() Talk +  named() Slot +  fromString() Track +  numbered()
  60. 60. natural abstractions beat artificial ones Bus Car <<interface>>   Vehicle Trip to work
  61. 61. 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
  62. 62. 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);          }  
  63. 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);                  $mySchedule  =  PersonalSchedule::ofConference($this-­‐>conference);          }  
  64. 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);                  $mySchedule-­‐>chooseTalk($talk);          }  
  65. 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);                  $this-­‐>schedule  =  PersonalSchedule::ofConference($this-­‐>conference);                  $this-­‐>schedule-­‐>chooseTalk($talk);          }  
  66. 66. Conference + namedWithTracks()   + scheduleTalk() Talk +  named() Slot +  fromString() Track +  numbered() PersonalSchedule + ofConference()   + chooseTalk()   + isTalkChosenForSlot()
  67. 67. It's ok to get it wrong Conversation Understanding
  68. 68. 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
  69. 69. 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);          }  
  70. 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);                  assertTrue($this-­‐>schedule-­‐>isTalkChosenForSlot($talk,  $slot));          }  
  71. 71. Conference + namedWithTracks()   + scheduleTalk() Talk +  named() Slot +  fromString() Track +  numbered() PersonalSchedule + ofConference()   + chooseTalk()   + isTalkChosenForSlot()
  72. 72. Conference + namedWithTracks()   + scheduleTalk() Talk +  named() Slot +  fromString() Track +  numbered() PersonalSchedule + ofConference()   + chooseTalk()   + isTalkChosenForSlot() ScheduledTalk + isForTalk()   + isScheduledFor()   + hasSameSlotAs()
  73. 73. Planting Object-oriented software Acceptance tests Unit-tests Domain core Inner objects
  74. 74. 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
  75. 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 #2
  76. 76. Conference + namedWithTracks()   + scheduleTalk() Talk +  named() Slot +  fromString() Track +  numbered() PersonalSchedule + ofConference()   + chooseTalk()   + isTalkChosenForSlot() ScheduledTalk + isForTalk()   + isScheduledFor()   + hasSameSlotAs() SlotIsAlreadyTaken
  77. 77. 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
  78. 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 / both scenarios
  79. 79. Shorter stakeholder feedback loops Domain PERSISTENCE UI Days / weeks
  80. 80. Part 2: the UI
  81. 81. UI is a controller for the domain
  82. 82. 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
  83. 83. Scenario 1 Scenario 2 Scenario 3 Scenario 4 Scenario 5 Scenario 6 DOMAIN ☑ ☑ ☑ ☑ ☑ ☑
  84. 84. Scenario 1 Scenario 2 Scenario 3 Scenario 4 Scenario 5 Scenario 6 DOMAIN UI ☑ ☑ ☑ ☑ ☑ ☑
  85. 85. Scenario 1 Scenario 2 Scenario 3 Scenario 4 Scenario 5 Scenario 6 DOMAIN UI ☑ ☑ ☑ ☑ ☑ ☑
  86. 86. Scenario 1 Scenario 2 Scenario 3 Scenario 4 Scenario 5 Scenario 6 DOMAIN UI ☑ ☑ ☑ ☑ ☑ ☑
  87. 87. Scenario 1 Scenario 2 Scenario 3 Scenario 4 Scenario 5 Scenario 6 DOMAIN ☑ ☑ UI ☑ ☑ ☑ ☑ ☑ ☑
  88. 88. 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
  89. 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 critical paths @critical
  90. 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   UI Layer / Scenario #1 @critical
  91. 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 / Step #1 @critical
  92. 92. class  WebAttendeeContext  extends  WebBasedContext  {          ...          /**            *  @Given  a  conference  named  :name  with  :count  track(s)            */          public  function  aConferenceNamedWithTrack($name,  $count)          {                  $this-­‐>conference  =  Conference::namedWithTracks($name,  $count);          }  
  93. 93. 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
  94. 94. 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);          }  
  95. 95. 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
  96. 96. class  WebAttendeeContext  extends  WebBasedContext  {          ...          /**            *  @When  I  choose  the  :name  talk  for  my  personal  schedule  of  this  conference            */          public  function  iChooseTheTalkForMyPersonalScheduleOfThisConference($name)          {                  throw  new  PendingException();          }  
  97. 97. 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()));          }  
  98. 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()));                  $talkElement  =  $this-­‐>find('css',  ".talk:contains('$name')");          }  
  99. 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')");                  $talkElement-­‐>clickLink('Add  to  my  schedule');          }  
  100. 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');          }          ...          /**            *  @Given  a  conference  named  :name  with  :count  track(s)            */          public  function  aConferenceNamedWithTrack($name,  $count)          {                  $this-­‐>conference  =  Conference::namedWithTracks($name,  $count);                  //  persist  somehow?          }  
  101. 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);                  $this-­‐>conferenceRepository-­‐>saveConference($this-­‐>conference);          }  
  102. 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);          }  
  103. 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)  was  planned            */          public  function  aConferenceNamedWithTrack($name,  $count)          {                  $this-­‐>conference  =  Conference::namedWithTracks($name,  $count);          }
  104. 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);                  $this-­‐>conferencePlanner-­‐>planConference($this-­‐>conference);          }
  105. 105. Coevolving Scenarios & Application code Scenarios App code
  106. 106. 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
  107. 107. class  WebAttendeeContext  extends  WebBasedContext  {          ...          /**            *  @Then  the  chosen  talk  for  :time  slot  should  be  the  :name            */          public  function  theChosenTalkForSlotShouldBeThe($name,  $time)          {                  throw  new  PendingException();          }  
  108. 108. 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);          }  
  109. 109. 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
  110. 110. Infrastructure Leakage
  111. 111. 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
  112. 112. "Hey, it does work" Testing pyramid Acceptance tests Unit Tests UI TESTS 1 scenario 2 scenarios 7 unit-test cases
  113. 113. “ – David West, Object Thinking Model the problem domain and the solution will take care of itself.
  114. 114. “Focus on discussing business problems and the architecture will emerge naturally.
  115. 115. Thanks to MathiasVerraes @mathiasverraes Dan North @tastapod Ciaran McNulty @CiaranMcNulty Aslak Hellesøy @aslak_hellesoy Marcello Duarte @_md INVIQA @inviqa
  116. 116. Thank you! @everzet

×