building behavior driven teams - phpcon poland 2014
DESCRIPTION
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.TRANSCRIPT
BUILDING BEHAVIOR DRIVEN TEAMS
PHPCon Poland 2014
Karol SójkoProject Leader @ Schibsted Tech Polska
@karolsojko
PHPers 3City organiser+
"
#BDD #PHP
#Symfony #TDD
#ImpactMapping #Agile #Team
Common Team Problems
ú
COMMUNICATIONExpect the unexpected
THE GREAT WALLBetween Us
Rambo Developers&
Colonel Trautman Managers
Outdated Documentationor what’s left of it
Tail ChasingLike a boss
BoomerangsPlease don’t come back
What Is BDD
z
Full Stack BDD
V
Behavior Driven Development
Inner QualityX
Outer Quality
Quality
Spec BDD Story BDD
#
$
Backlog
Story BDD
Features
Scenarios
Green
Refactor
Red
StoryBDD & SpecBDD
Spec BDD
Impact Mappingq
Why
Who
HowWhat
Who
HowWhat
What…
…
Impact Mapping
Increase Books Sale
Who
HowWhat
Who
HowWhat
What…
…
Impact Mapping
Increase Books Sale
Readers
HowWhat
Authors
HowWhat
What…
…
Impact Mapping
Increase Books Sale
Readers
Organize Events
What
Authors
Make Book Clubs Popular
What
What…
…
Impact Mapping
Increase Books Sale
Readers
Organize Events
Inviting Readers
Authors
Make Book Clubs Popular
Voting for books
Creating book clubs…
…
Impact Mapping
Living Documentation`
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
Increase Books Sale
Readers
Organize Events
Inviting Readers
Authors
Make Book Clubs Popular
Voting for books
Creating book clubs…
…
Refine ExamplesBeforeGiven I am a registered userWhen I create a book clubThen all users can join it
Given I am logged in as “[email protected]” When I am on book club creation pageAnd I fill in “Name” with “PHP Book Club” And I press “Create” Then a pubic book club “PHP Book Club” should exist !
After
Being SpecificY
/** * @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
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
BDD in your CompanyZ
Business and Development
When you have a hammer …
Avoid Buzz Words
The Batman
Don’t attack every angle
Measure business valuesnot developers
Use Case #1 The Comet CultB
Small Team
4 Different Locations
Communication Breakdown
Us and Them
The Guesstimates
Rock Solid
Issue reincarnation
What to test?
Use Case #2 SchibstedB
Team building 101
Buzz word project
Mind reading
Achievement Unlockedf
Goal Comprehension
Release soon & adjust quickly
Focus on Quality
Client’s Trust
Quicker Agile Adoption
The Team
Good Reads
Question Time!
https://joind.in/talk/view/11851
http://behaviordriventeams.com