Behaviour Driven  Developmentwith C# & F#<br />Phil Trelford / @ptrelford<br />
Agile Manifesto<br />Individuals and interactions over <br />    processes and tools<br />Working software over <br />    ...
Collaboration<br />
User Stories<br />
Acceptance Tests<br />Refunded items should be returned to stock<br />Given  a customer buys a black jumper<br />And I hav...
Test Driven Development (TDD)<br />Benefits<br />Facilitates change<br />Refactoring<br />Regression Testing<br />Document...
Unit Testing<br />“A good unit test needs both to illustrate and define the behavioural contract of the unit in question. ...
Behaviour Driven Development(BDD) <br />“Is an agile software development technique that encourages collaboration between<...
Behaviour Driven Development (BDD)<br />Benefits<br />Facilitates Change<br />Refactoring<br />Regression<br />Rewriting<b...
Team Workshops<br />
BA + Developer + QA<br />
Testers find holes<br />
BDD Frameworks<br />External DSL<br />Cuke4Nuke<br />NBehave<br />StorEvil<br />SpecFlow<br />TickSpec<br />Internal DSL<b...
Declarations<br />Gherkin<br />Given I input 5<br />When calculating the factorial<br />Then the result is 120<br />Natura...
First Steps in BDD on .Net<br />
Look no hands<br />
Look no hands<br />
TickSpec<br />
Demo <br />
Step away from the tools<br />“Start by having conversations, engaging both testers and business stakeholders<br />If you ...
BDD Patterns: Tables<br />Scenario: Winning positions<br />	Given a board layout:<br />		| 1 | 2 | 3	|<br />		| O | O | X ...
BDD Patterns: Examples<br />Scenario: Winning positions<br />	Given a board layout:<br />		| 1 | 2 | 3	|<br />		| O | O | ...
BDD Books<br />
Lifetime BDD Awards<br />
Q & A<br />Or contact me in confidence:<br />Twitter: @ptrelford<br />E-mail: phil(at)trelford.com<br />In-person: http://...
Upcoming SlideShare
Loading in …5
×

BDD with F# at DDDBelfast

3,180 views

Published on

Talk presented at DDD Belfast in October 2011. Session abstract: http://www.developerdeveloperdeveloper.com/dddie11/ViewSession.aspx?SessionID=748

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,180
On SlideShare
0
From Embeds
0
Number of Embeds
891
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • http://www.stickyminds.com/sitewide.asp?Function=edetail&amp;ObjectType=ART&amp;ObjectId=13833&amp;tth=DYN&amp;tt=siteemail&amp;iDyn=2Key part here is “A good unit test needs to define the behavioural contract”These kind of observations were what prompted Dan North into evolving TDD into BDD, which is what we will discuss next.
  • This is a description of what BDD is and how it relates to TDD.
  • BDD also known as Acceptance Test Driven Development etc.
  • BDD with F# at DDDBelfast

    1. 1. Behaviour Driven Developmentwith C# & F#<br />Phil Trelford / @ptrelford<br />
    2. 2.
    3. 3. Agile Manifesto<br />Individuals and interactions over <br /> processes and tools<br />Working software over <br /> comprehensive documentation<br />Customer collaboration over <br /> contract negotiation<br />Responding to change over <br /> following a plan<br />
    4. 4. Collaboration<br />
    5. 5. User Stories<br />
    6. 6. Acceptance Tests<br />Refunded items should be returned to stock<br />Given a customer buys a black jumper<br />And I have 3 black jumpers left in stock<br />When he returns the blackjumper for a refund<br />Then I should have 4 black jumpers in stock<br />
    7. 7. Test Driven Development (TDD)<br />Benefits<br />Facilitates change<br />Refactoring<br />Regression Testing<br />Documentation<br />API<br />Living Documentation<br />Design<br />Classes, Methods<br />Behaviour<br />
    8. 8. Unit Testing<br />“A good unit test needs both to illustrate and define the behavioural contract of the unit in question. Behaviour is more than just individual methods…” – KevlinHenney<br />
    9. 9. Behaviour Driven Development(BDD) <br />“Is an agile software development technique that encourages collaboration between<br />Developers<br />QA<br />Business Participants<br /> in a software project.”<br />“It extends TDD by writing test cases in a <br />natural language that non-programmers can read.”<br />
    10. 10. Behaviour Driven Development (BDD)<br />Benefits<br />Facilitates Change<br />Refactoring<br />Regression<br />Rewriting<br />Documentation<br />Behaviour<br />Living Documentation<br />Domain Language<br />Defines Done<br />When all tests pass<br />
    11. 11. Team Workshops<br />
    12. 12. BA + Developer + QA<br />
    13. 13. Testers find holes<br />
    14. 14. BDD Frameworks<br />External DSL<br />Cuke4Nuke<br />NBehave<br />StorEvil<br />SpecFlow<br />TickSpec<br />Internal DSL<br />MSpec<br />NaturalSpec<br />NSpec<br />SpecsFor<br />StoryQ<br />
    15. 15. Declarations<br />Gherkin<br />Given I input 5<br />When calculating the factorial<br />Then the result is 120<br />NaturalSpec<br />[<Scenario>] let <br />``When calculating factorial of 5 it should equal 120``() = <br />Given 5 <br />|> When calculating factorial <br />|> It should equal 120 <br />|> Verify <br />
    16. 16. First Steps in BDD on .Net<br />
    17. 17. Look no hands<br />
    18. 18. Look no hands<br />
    19. 19. TickSpec<br />
    20. 20. Demo <br />
    21. 21. Step away from the tools<br />“Start by having conversations, engaging both testers and business stakeholders<br />If you can’t have those conversations, stop. You can’t do BDD” – Liz Keogh<br />
    22. 22. BDD Patterns: Tables<br />Scenario: Winning positions<br /> Given a board layout:<br /> | 1 | 2 | 3 |<br /> | O | O | X |<br /> | O | | |<br /> | X | | X |<br /> When a player marks X at middle right<br /> Then X wins<br />
    23. 23. BDD Patterns: Examples<br />Scenario: Winning positions<br /> Given a board layout:<br /> | 1 | 2 | 3 |<br /> | O | O | X |<br /> | O | | |<br /> | X | | X |<br /> When a player marks X at <row> <col> <br /> Then X wins<br />Examples:<br /> | row | col | <br /> | middle | right |<br /> | middle | middle |<br /> | bottom | middle |<br />
    24. 24. BDD Books<br />
    25. 25. Lifetime BDD Awards<br />
    26. 26. Q & A<br />Or contact me in confidence:<br />Twitter: @ptrelford<br />E-mail: phil(at)trelford.com<br />In-person: http://meetup.com/FSharpLondon<br />

    ×