Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Behavior Driven Teams - PHPCon Poland 2014

Karol Sójko
September 24, 2014

Building Behavior Driven Teams - PHPCon Poland 2014

Many teams in their development process tend to focus on answering the question “how” instead of “why”. This leads to many misunderstandings which in turn decrease productivity and pleasure of working.
In my presentation I waned to introduce Behavior Driven Development which is one of the ways to improve communication within a team. I will share my knowledge on how to start with BDD in your company and say a couple of words about things like StoryBDD, SpecBDD and living documentation. Taking my team as a use case I will also speak about how BDD helped us in understanding each other and making software that matters.

Karol Sójko

September 24, 2014
Tweet

More Decks by Karol Sójko

Other Decks in Programming

Transcript

  1. BUILDING
    BEHAVIOR DRIVEN
    TEAMS
    PHPCon Poland 2014

    View Slide

  2. Karol Sójko
    Project Leader @ Schibsted Tech Polska
    @karolsojko
    PHPers 3City organiser
    +
    "
    Ö [email protected]
    #BDD
    #PHP
    #Symfony
    #TDD
    #ImpactMapping
    #Agile
    #Team

    View Slide

  3. Common
    Team
    Problems
    ú

    View Slide

  4. COMMUNICATION
    Expect the unexpected

    View Slide

  5. THE GREAT WALL
    Between Us

    View Slide

  6. Rambo Developers
    &
    Colonel Trautman Managers

    View Slide

  7. Outdated Documentation
    or what’s left of it

    View Slide

  8. Tail Chasing
    Like a boss

    View Slide

  9. Boomerangs
    Please don’t come back

    View Slide

  10. What
    Is
    BDD
    z

    View Slide

  11. Full Stack BDD
    V
    Behavior Driven Development
    Inner Quality
    X
    Outer Quality
    Quality
    Spec BDD Story BDD

    View Slide

  12. #
    $
    Backlog
    Story BDD
    Features
    Scenarios
    Green
    Refactor
    Red
    StoryBDD & SpecBDD
    Spec BDD

    View Slide

  13. Impact
    Mapping
    q

    View Slide

  14. Why
    Who
    How
    What
    Who
    How
    What
    What


    Impact Mapping

    View Slide

  15. Increase
    Books Sale
    Who
    How
    What
    Who
    How
    What
    What


    Impact Mapping

    View Slide

  16. Increase
    Books Sale
    Readers
    How
    What
    Authors
    How
    What
    What


    Impact Mapping

    View Slide

  17. Increase
    Books Sale
    Readers
    Organize
    Events
    What
    Authors
    Make Book
    Clubs Popular
    What
    What


    Impact Mapping

    View Slide

  18. Increase
    Books Sale
    Readers
    Organize
    Events
    Inviting
    Readers
    Authors
    Make Book
    Clubs Popular
    Voting for
    books
    Creating
    book clubs


    Impact Mapping

    View Slide

  19. Living
    Documentation
    `

    View Slide

  20. Increase
    Books Sale
    Readers
    Organize
    Events
    Inviting
    Readers
    Authors
    Make Book
    Clubs Popular
    Voting for
    books
    Creating
    book clubs


    Scenario Workshop
    Feature: Creating book clubs

    In order to make book clubs popular

    As a reader

    I want to create book clubs


    Scenario: Successfully creating a book club

    Given I am a registered user

    When I create a book club

    Then all users can join it

    View Slide

  21. Increase
    Books Sale
    Readers
    Organize
    Events
    Inviting
    Readers
    Authors
    Make Book
    Clubs Popular
    Voting for
    books
    Creating
    book clubs


    Refine Examples
    Before
    Given I am a registered user

    When I create a book club

    Then all users can join it
    Given I am logged in as “[email protected]”

    When I am on book club creation page

    And I fill in “Name” with “PHP Book Club”

    And I press “Create”

    Then a pubic book club “PHP Book Club” should exist
    !
    After

    View Slide

  22. Being
    Specific
    Y

    View Slide

  23. /**

    * @Then a public book club :bookClubName should exist

    */

    public function aPublicBookClubShouldExist($bookClubName)

    {

    $dm = $this->getDocumentManager();

    $bookClub = $dm->getRepository('AcmeDemoBundle:BookClub')

    ->findOneBy(array('email' => $bookClubName));


    if (empty($bookClub)) {

    throw new \Exception(sprintf(

    'Book club %s has not been found',

    $bookClubName

    ));

    }

    }
    Behat steps

    View Slide

  24. use PhpSpec\ObjectBehavior;


    class BookClubSpec extends ObjectBehavior

    {

    /**

    * @param Acme\DemoBundle\Document\User $user

    */

    function it_should_be_available_for_readers($user)

    {

    $user->isReader()->willReturn(true);


    $this->isAvailableFor($user)->shouldReturn(true);

    }


    /**

    * @param Acme\DemoBundle\Document\User $user

    */

    function it_should_not_be_available_for_readers_if_premium($user)

    {

    $user->isReader()->willReturn(true);

    $this->setPremium(true);


    $this->isAvailableFor($user)->shouldReturn(false);

    }


    }
    class BookClub

    {

    protected $premium;


    /**

    * @param $premium

    */

    public function setPremium($premium)

    {

    $this->premium = $premium;

    }


    /**

    * @param User $user

    *

    * @return bool

    */

    public function isAvailableFor(User $user)

    {

    return $user->isReader() && !$this->premium;

    }

    }
    PhpSpec Implementation

    View Slide

  25. BDD
    in your Company
    Z

    View Slide

  26. Business and Development

    View Slide

  27. When you have a hammer …

    View Slide

  28. Avoid Buzz Words

    View Slide

  29. The Batman

    View Slide

  30. Don’t attack every angle

    View Slide

  31. Measure business values
    not developers

    View Slide

  32. Use Case #1
    The Comet Cult
    B

    View Slide

  33. Small Team

    View Slide

  34. 4 Different Locations

    View Slide

  35. Communication Breakdown

    View Slide

  36. Us and Them

    View Slide

  37. The Guesstimates

    View Slide

  38. Rock Solid

    View Slide

  39. Issue reincarnation

    View Slide

  40. What to test?

    View Slide

  41. Use Case #2
    Schibsted
    B

    View Slide

  42. Team building 101

    View Slide

  43. Buzz word project

    View Slide

  44. Mind reading

    View Slide

  45. Achievement
    Unlocked
    f

    View Slide

  46. Goal Comprehension

    View Slide

  47. Release soon & adjust quickly

    View Slide

  48. Focus on Quality

    View Slide

  49. Client’s Trust

    View Slide

  50. Quicker Agile Adoption

    View Slide

  51. The Team

    View Slide

  52. Good Reads

    View Slide

  53. Question Time!
    https://joind.in/talk/view/11851
    http://behaviordriventeams.com

    View Slide