• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
BDD in open source projects - Is it really beneficial?
 

BDD in open source projects - Is it really beneficial?

on

  • 2,960 views

You can easily use tools such as Behat and phpspec for practicing BDD in PHP. Regardless of the specific BDD tools, the question of how to do BDD “properly” arises. According to Dan North, ...

You can easily use tools such as Behat and phpspec for practicing BDD in PHP. Regardless of the specific BDD tools, the question of how to do BDD “properly” arises. According to Dan North, initiator of the BDD philosophy, it should be be practiced as a “mutliple-stakeholder, agile methodology”. However, most open-source projects are not developed with an explicit agile methodology. Also, there are hardly any stakeholder roles that are clearly distinguishable from each other - often contributor and user are actually one and the same. So, in the case of open-source projects, you can question the benefit of BDD.

Statistics

Views

Total Views
2,960
Views on SlideShare
2,554
Embed Views
406

Actions

Likes
6
Downloads
18
Comments
0

7 Embeds 406

http://www.ymc.ch 332
https://twitter.com 28
http://librosweb.es 19
http://librosweb.dev 19
http://lw.192.168.2.10.xip.io 6
http://lanyrd.com 1
http://www.conferize.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    BDD in open source projects - Is it really beneficial? BDD in open source projects - Is it really beneficial? Presentation Transcript

    • BDD in open-source projects Is it really beneficial? FABIAN KISS
    • I AM Fabian Kiss @head_revision headrevision Passionate Behat user, contributor, and blogger
    • I WORK AT
    • WE ARE HERE www.ymc.ch @ymc_ch
    • I WILL Question BDD!
    • I WILL Question BDD! Dan North: « BDD is a [...] multiple-stakeholder, agile methodology »
    • I WILL Question BDD! Dan North: « BDD is a [...] multiple-stakeholder, agile methodology » BDD is beneficial in agile customer projects.
    • I WILL Question BDD! Dan North: « BDD is a [...] multiple-stakeholder, agile methodology » BDD is beneficial in agile customer projects. customer pays → explicit customer → agile process
    • I WILL Question BDD! Dan North: « BDD is a [...] multiple-stakeholder, agile methodology » BDD is beneficial in agile customer projects. open-source projects customer pays → explicit customer → agile process developers work for free → no explicit customer → emergent process
    • I WILL Question BDD! Dan North: « BDD is a [...] multiple-stakeholder, agile methodology » BDD is beneficial in agile customer projects. customer pays → explicit customer → agile process Is it beneficial in open-source projects as well? developers work for free → no explicit customer → emergent process
    • PRIME EXAMPLE
    • PRIME EXAMPLE USES BOTH TOOLS
    • BDD IS NOT ABOUT TOOLS
    • BDD IS NOT ABOUT TOOLS BDD IS ABOUT METHODOLOGY
    • TOOL
    • METHOD TOOL SpecBDD StoryBDD
    • METHOD SYNTAX TOOL SpecBDD Code, Functions/Methods as specifications StoryBDD
    • METHOD SYNTAX TOOL SpecBDD function it_greets_with_hello_world() { $this->greet()->shouldReturn( 'Hello World' ); } StoryBDD
    • METHOD SYNTAX TOOL SpecBDD function it_greets_with_hello_world() { $this->greet()->shouldReturn( 'Hello World' ); } StoryBDD Plain text, one or more scenarios for (fictitious) user story, described as prose in givenwhen-then scheme (Gherkin syntax)
    • METHOD SYNTAX TOOL SpecBDD function it_greets_with_hello_world() { $this->greet()->shouldReturn( 'Hello World' ); } StoryBDD Scenario: Given a When an Then an A successful scenario precondition event occurred outcome is achieved
    • METHOD SpecBDD NOTION Dan North 2003: SYNTAX function it_greets_with_hello_world() { $this->greet()->shouldReturn( 'Hello World' ); } StoryBDD TOOL names of test methods describe intended behavior Scenario: Given a When an Then an A successful scenario precondition event occurred outcome is achieved
    • METHOD NOTION SYNTAX TOOL SpecBDD StoryBDD “TDD done right” function it_greets_with_hello_world() { $this->greet()->shouldReturn( 'Hello World' ); } Scenario: Given a When an Then an A successful scenario precondition event occurred outcome is achieved
    • QUESTION #1 Should you use SpecBDD as substitute for xUnit?
    • QUESTION #1 Should you use SpecBDD as substitute for xUnit? phpspec PHPUnit
    • QUESTION #1 Should you use SpecBDD as substitute for xUnit? phpspec CUSTOMER PROJECT no problem in principal PHPUnit
    • QUESTION #1 Should you use SpecBDD as substitute for xUnit? phpspec CUSTOMER PROJECT OPEN-SOURCE PROJECT PHPUnit no problem in principal community developers unfamiliar with the code might be irritated
    • QUESTION #1 Should you use SpecBDD as substitute for xUnit? phpspec CUSTOMER PROJECT OPEN-SOURCE PROJECT PHPUnit no problem in principal community developers unfamiliar with the code might be irritated “Where are the unit tests?” “How to unit test with that?”
    • QUESTION #1 Should you use SpecBDD as substitute for xUnit? phpspec CUSTOMER PROJECT OPEN-SOURCE PROJECT PHPUnit no problem in principal community developers unfamiliar with the code might be irritated “Where are the unit tests?” “How to unit test with that?”
    • METHOD NOTION SYNTAX TOOL SpecBDD StoryBDD ? “TDD done right” function it_greets_with_hello_world() { $this->greet()->shouldReturn( 'Hello World' ); } Scenario: Given a When an Then an A successful scenario precondition event occurred outcome is achieved
    • METHOD SpecBDD StoryBDD Dan North 2011: NOTION SYNTAX TOOL “TDD done right” function it_greets_with_hello_world() { $this->greet()->shouldReturn( 'Hello World' ); } « BDD is about understanding the customer's need [...] (and being able to prove that with an evolving suite of acceptance tests) » Scenario: Given a When an Then an A successful scenario precondition event occurred outcome is achieved
    • METHOD NOTION SYNTAX TOOL SpecBDD “TDD done right” function it_greets_with_hello_world() { $this->greet()->shouldReturn( 'Hello World' ); } StoryBDD understanding customer’s need + evolving suite of acceptance tests Scenario: Given a When an Then an A successful scenario precondition event occurred outcome is achieved
    • STORYBDD IN DETAIL
    • STORYBDD IN DETAIL implementing something correctly && implementing the right thing
    • STORYBDD IN DETAIL implementing something correctly && implementing the right thing acceptance tests are secondary to the understanding
    • STORYBDD IN DETAIL implementing something correctly && implementing the right thing acceptance tests are secondary to the understanding customer explicitly asks for their production && co-produces them
    • STORYBDD IN DETAIL implementing something correctly && implementing the right thing acceptance tests are secondary to the understanding customer explicitly asks for their production && co-produces them
    • QUESTION #2 Who decides what the right thing is?
    • QUESTION #2 Who decides what the right thing is? CUSTOMER PROJECT customer, thus no problem
    • QUESTION #2 Who decides what the right thing is? CUSTOMER PROJECT OPEN-SOURCE PROJECT customer, thus no problem developer, thus potential problem
    • QUESTION #2 Who decides what the right thing is? CUSTOMER PROJECT OPEN-SOURCE PROJECT customer, thus no problem developer, thus potential problem customer === (other) developers (i.e. bundle level) → no problem elsewise (i.e. application level) → “language of the customer” is not met
    • QUESTION #2 Who decides what the right thing is? CUSTOMER PROJECT OPEN-SOURCE PROJECT customer, thus no problem developer, thus potential problem customer === (other) developers (i.e. bundle level) → no problem elsewise (i.e. application level) → “language of the customer” is not met
    • STORYBDD IN DETAIL implementing something correctly && implementing the right thing acceptance tests are secondary to the understanding customer explicitly asks for their production && co-produces them
    • QUESTION #3 How to facilitate understanding?
    • QUESTION #3 How to facilitate understanding? CUSTOMER PROJECT face-to-face communication, thus no problem
    • QUESTION #3 How to facilitate understanding? CUSTOMER PROJECT OPEN-SOURCE PROJECT face-to-face communication, thus no problem communication mainly via issue tracker. pull requests, Twitter, etc. → StoryBDD is impeded
    • QUESTION #3 How to facilitate understanding? CUSTOMER PROJECT OPEN-SOURCE PROJECT face-to-face communication, thus no problem communication mainly via issue tracker. pull requests, Twitter, etc. → StoryBDD is impeded → but StoryBDD is the solution
    • QUESTION #3 How to facilitate understanding? CUSTOMER PROJECT OPEN-SOURCE PROJECT face-to-face communication, thus no problem communication mainly via issue tracker. pull requests, Twitter, etc. → StoryBDD is impeded → but StoryBDD is the solution (watching the execution of the Behat suite live in a browser facilitates your understanding about the features of the open-source project)
    • QUESTION #3 How to facilitate understanding? CUSTOMER PROJECT OPEN-SOURCE PROJECT face-to-face communication, thus no problem communication mainly via issue tracker. pull requests, Twitter, etc. → StoryBDD is impeded → but StoryBDD is the solution (but browser is emulated so far) (watching the execution of the Behat suite live in a browser facilitates your understanding about the features of the open-source project)
    • STORYBDD IN DETAIL implementing something correctly && implementing the right thing acceptance tests are secondary to the understanding customer explicitly asks for their production && co-produces them
    • QUESTION #4 Who asks for their production?
    • QUESTION #4 Who asks for their production? CUSTOMER PROJECT customer, thus no problem
    • QUESTION #4 Who asks for their production? CUSTOMER PROJECT OPEN-SOURCE PROJECT customer, thus no problem (some) community developers, thus potential problem
    • QUESTION #4 Who asks for their production? CUSTOMER PROJECT OPEN-SOURCE PROJECT customer, thus no problem (some) community developers, thus potential problem StoryBDD might be process overhead → more impediment than benefit
    • QUESTION #4 Who asks for their production? CUSTOMER PROJECT OPEN-SOURCE PROJECT customer, thus no problem (some) community developers, thus potential problem StoryBDD might be process overhead → more impediment than benefit “The code doesn’t get green anymore!” “If the worst comes to the worst, who decides to abandon Behat?”
    • QUESTION #4 Who asks for their production? CUSTOMER PROJECT OPEN-SOURCE PROJECT customer, thus no problem (some) community developers, thus potential problem StoryBDD might be process overhead → more impediment than benefit “The code doesn’t get green anymore!” (at early development stage) “If the worst comes to the worst, who decides to abandon Behat?”
    • CONCLUSION
    • CONCLUSION
    • CONCLUSION SpecBDD might benefit open-source projects.
    • CONCLUSION SpecBDD might benefit open-source projects. StoryBDD might benefit open-source projects.
    • CONCLUSION SpecBDD might benefit open-source projects. StoryBDD might benefit open-source projects. (even more than customer projects)
    • CONCLUSION SpecBDD might benefit open-source projects. StoryBDD might benefit open-source projects. (even more than customer projects) StoryBDD might impede open-source projects.
    • CONCLUSION SpecBDD might benefit open-source projects. StoryBDD might benefit open-source projects. (even more than customer projects) StoryBDD might impede open-source projects. What to do?
    • CONCLUSION SpecBDD might benefit open-source projects. StoryBDD might benefit open-source projects. (even more than customer projects) StoryBDD might impede open-source projects. What to do? Contribute!
    • CONCLUSION SpecBDD might benefit open-source projects. StoryBDD might benefit open-source projects. (even more than customer projects) StoryBDD might impede open-source projects. What to do? Contribute! e.g.
    • QUESTIONS? fabian.kiss@ymc.ch @head_revision www.ymc.ch Quotes: Slide 06: How to sell BDD to the business by Dan North Slide 32: Defining BDD by Dan North Photo Credits: Slide 01: off to save something by bokeh burger Slide 04: Alpkäse, Aeschi bei Spiez by Time.Captured Slide 12: Background image by Sylius Slide 15: Swiss Army by Jim Pennucci Slide 58: Vancouver Symphony Orchestra with Bramwell Tovey by Vancouver 125