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 cu...
I WILL

Question BDD!
Dan North: « BDD is a [...] multiple-stakeholder, agile methodology »

BDD is beneficial in agile cu...
I WILL

Question BDD!
Dan North: « BDD is a [...] multiple-stakeholder, agile methodology »

BDD is beneficial in agile cu...
I WILL

Question BDD!
Dan North: « BDD is a [...] multiple-stakeholder, agile methodology »

BDD is beneficial in agile cu...
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'
);
}

S...
METHOD

SYNTAX

TOOL

SpecBDD

function it_greets_with_hello_world()
{
$this->greet()->shouldReturn(
'Hello World'
);
}

S...
METHOD

SYNTAX

TOOL

SpecBDD

function it_greets_with_hello_world()
{
$this->greet()->shouldReturn(
'Hello World'
);
}

S...
METHOD

SpecBDD

NOTION

Dan North 2003:

SYNTAX

function it_greets_with_hello_world()
{
$this->greet()->shouldReturn(
'H...
METHOD

NOTION

SYNTAX

TOOL

SpecBDD

StoryBDD

“TDD done right”

function it_greets_with_hello_world()
{
$this->greet()-...
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 pr...
QUESTION #1

Should you use SpecBDD as substitute for xUnit?
phpspec
CUSTOMER
PROJECT

OPEN-SOURCE
PROJECT

PHPUnit

no pr...
QUESTION #1

Should you use SpecBDD as substitute for xUnit?
phpspec
CUSTOMER
PROJECT

OPEN-SOURCE
PROJECT

PHPUnit

no pr...
METHOD

NOTION

SYNTAX

TOOL

SpecBDD

StoryBDD

?

“TDD done right”

function it_greets_with_hello_world()
{
$this->greet...
METHOD

SpecBDD

StoryBDD
Dan North 2011:

NOTION

SYNTAX

TOOL

“TDD done right”

function it_greets_with_hello_world()
{...
METHOD

NOTION

SYNTAX

TOOL

SpecBDD

“TDD done right”

function it_greets_with_hello_world()
{
$this->greet()->shouldRet...
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...
STORYBDD IN DETAIL

implementing something correctly && implementing the right thing
acceptance tests are secondary to the...
STORYBDD IN DETAIL

implementing something correctly && implementing the right thing
acceptance tests are secondary to the...
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

devel...
QUESTION #2

Who decides what the right thing is?

CUSTOMER
PROJECT

OPEN-SOURCE
PROJECT

customer, thus no problem

devel...
QUESTION #2

Who decides what the right thing is?

CUSTOMER
PROJECT

OPEN-SOURCE
PROJECT

customer, thus no problem

devel...
STORYBDD IN DETAIL

implementing something correctly && implementing the right thing
acceptance tests are secondary to the...
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 ...
QUESTION #3

How to facilitate understanding?

CUSTOMER
PROJECT

OPEN-SOURCE
PROJECT

face-to-face communication, thus no ...
QUESTION #3

How to facilitate understanding?

CUSTOMER
PROJECT

OPEN-SOURCE
PROJECT

face-to-face communication, thus no ...
QUESTION #3

How to facilitate understanding?

CUSTOMER
PROJECT

OPEN-SOURCE
PROJECT

face-to-face communication, thus no ...
STORYBDD IN DETAIL

implementing something correctly && implementing the right thing
acceptance tests are secondary to the...
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) comm...
QUESTION #4

Who asks for their production?

CUSTOMER
PROJECT

OPEN-SOURCE
PROJECT

customer, thus no problem

(some) comm...
QUESTION #4

Who asks for their production?

CUSTOMER
PROJECT

OPEN-SOURCE
PROJECT

customer, thus no problem

(some) comm...
QUESTION #4

Who asks for their production?

CUSTOMER
PROJECT

OPEN-SOURCE
PROJECT

customer, thus no problem

(some) comm...
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 custo...
CONCLUSION

SpecBDD might benefit open-source projects.
StoryBDD might benefit open-source projects.
(even more than custo...
CONCLUSION

SpecBDD might benefit open-source projects.
StoryBDD might benefit open-source projects.
(even more than custo...
CONCLUSION

SpecBDD might benefit open-source projects.
StoryBDD might benefit open-source projects.
(even more than custo...
CONCLUSION

SpecBDD might benefit open-source projects.
StoryBDD might benefit open-source projects.
(even more than custo...
QUESTIONS?
fabian.kiss@ymc.ch
@head_revision
www.ymc.ch

Quotes:
Slide 06: How to sell BDD to the business by Dan North
Sl...
BDD in open source projects - Is it really beneficial?
BDD in open source projects - Is it really beneficial?
Upcoming SlideShare
Loading in...5
×

BDD in open source projects - Is it really beneficial?

3,971

Published on

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.

Published in: Technology
0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,971
On Slideshare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
20
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide

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

  1. 1. BDD in open-source projects Is it really beneficial? FABIAN KISS
  2. 2. I AM Fabian Kiss @head_revision headrevision Passionate Behat user, contributor, and blogger
  3. 3. I WORK AT
  4. 4. WE ARE HERE www.ymc.ch @ymc_ch
  5. 5. I WILL Question BDD!
  6. 6. I WILL Question BDD! Dan North: « BDD is a [...] multiple-stakeholder, agile methodology »
  7. 7. I WILL Question BDD! Dan North: « BDD is a [...] multiple-stakeholder, agile methodology » BDD is beneficial in agile customer projects.
  8. 8. 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
  9. 9. 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
  10. 10. 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
  11. 11. PRIME EXAMPLE
  12. 12. PRIME EXAMPLE USES BOTH TOOLS
  13. 13. BDD IS NOT ABOUT TOOLS
  14. 14. BDD IS NOT ABOUT TOOLS BDD IS ABOUT METHODOLOGY
  15. 15. TOOL
  16. 16. METHOD TOOL SpecBDD StoryBDD
  17. 17. METHOD SYNTAX TOOL SpecBDD Code, Functions/Methods as specifications StoryBDD
  18. 18. METHOD SYNTAX TOOL SpecBDD function it_greets_with_hello_world() { $this->greet()->shouldReturn( 'Hello World' ); } StoryBDD
  19. 19. 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)
  20. 20. 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
  21. 21. 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
  22. 22. 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
  23. 23. QUESTION #1 Should you use SpecBDD as substitute for xUnit?
  24. 24. QUESTION #1 Should you use SpecBDD as substitute for xUnit? phpspec PHPUnit
  25. 25. QUESTION #1 Should you use SpecBDD as substitute for xUnit? phpspec CUSTOMER PROJECT no problem in principal PHPUnit
  26. 26. 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
  27. 27. 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?”
  28. 28. 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?”
  29. 29. 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
  30. 30. 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
  31. 31. 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
  32. 32. STORYBDD IN DETAIL
  33. 33. STORYBDD IN DETAIL implementing something correctly && implementing the right thing
  34. 34. STORYBDD IN DETAIL implementing something correctly && implementing the right thing acceptance tests are secondary to the understanding
  35. 35. 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
  36. 36. 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
  37. 37. QUESTION #2 Who decides what the right thing is?
  38. 38. QUESTION #2 Who decides what the right thing is? CUSTOMER PROJECT customer, thus no problem
  39. 39. QUESTION #2 Who decides what the right thing is? CUSTOMER PROJECT OPEN-SOURCE PROJECT customer, thus no problem developer, thus potential problem
  40. 40. 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
  41. 41. 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
  42. 42. 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
  43. 43. QUESTION #3 How to facilitate understanding?
  44. 44. QUESTION #3 How to facilitate understanding? CUSTOMER PROJECT face-to-face communication, thus no problem
  45. 45. 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
  46. 46. 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
  47. 47. 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)
  48. 48. 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)
  49. 49. 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
  50. 50. QUESTION #4 Who asks for their production?
  51. 51. QUESTION #4 Who asks for their production? CUSTOMER PROJECT customer, thus no problem
  52. 52. QUESTION #4 Who asks for their production? CUSTOMER PROJECT OPEN-SOURCE PROJECT customer, thus no problem (some) community developers, thus potential problem
  53. 53. 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
  54. 54. 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?”
  55. 55. 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?”
  56. 56. CONCLUSION
  57. 57. CONCLUSION
  58. 58. CONCLUSION SpecBDD might benefit open-source projects.
  59. 59. CONCLUSION SpecBDD might benefit open-source projects. StoryBDD might benefit open-source projects.
  60. 60. CONCLUSION SpecBDD might benefit open-source projects. StoryBDD might benefit open-source projects. (even more than customer projects)
  61. 61. CONCLUSION SpecBDD might benefit open-source projects. StoryBDD might benefit open-source projects. (even more than customer projects) StoryBDD might impede open-source projects.
  62. 62. 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?
  63. 63. 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!
  64. 64. 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.
  65. 65. 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
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×