• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
NDC 2011 - SpecFlow: Pragmatic BDD for .NET
 

NDC 2011 - SpecFlow: Pragmatic BDD for .NET

on

  • 4,068 views

Slides from the session at the Norwegian Developers Conference 2011 by Gaspar Nagy and Jonas Bandi.

Slides from the session at the Norwegian Developers Conference 2011 by Gaspar Nagy and Jonas Bandi.

Statistics

Views

Total Views
4,068
Views on SlideShare
3,572
Embed Views
496

Actions

Likes
7
Downloads
0
Comments
0

7 Embeds 496

http://blog.jonasbandi.net 475
url_unknown 12
http://www.slideshare.net 3
http://www.hanrss.com 2
http://feeds.feedburner.com 2
http://www.dnug-bern.ch 1
http://carbone.rssing.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via SlideShare as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

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

    NDC 2011 - SpecFlow: Pragmatic BDD for .NET NDC 2011 - SpecFlow: Pragmatic BDD for .NET Presentation Transcript

    • SpecFlow:Pragmatic BDD for .NETNDC 2011 GASPAR NAGY gn@techtalk.at Twitter: @gasparnagy JONAS BANDI jonas.bandi@techtalk.ch Twitter: @jbandiOslo, 8. June 2011 COPYRIGHT 2011, TECHTALK - WWW.TECHTALK.CH
    • TechTalk at a glance• Established: 1993• Branches: Austria, Hungary, Switzerland• 3 Managing partners: no external owners• Employees: ~ 60 employees• Turnover 2010: ~ 7 Mio CHF• Risk rating: very low risk• Self-financing, healthy growth TechTalk office, Vienna/Austria COPYRIGHT 2011, TECHTALK - WWW.TECHTALK.CH
    • The audience?• Who is practicing agile Development?• Who is practicing TDD?• Who is doing Acceptance Test Driven Development or Behavior Driven Development?• Who is using Cucumber, Fitnesse, Concordion, NBehave or a similar tool?• Who knows SpecFlow?3
    • Overview & Agenda• BDD: Summary• SpecFlow Introduction• Demo: SpecFlow Hands On• Demo: MonoDevelop• Q&A The research is partially supported by the project of Eötvös Loránd University: TÁMOP-4.2.1.B-09/1/KMR-2010-00034
    • BDD – A definition from Dan North BDD is a second-generation, outside-in, pull-based, multiple- stakeholder, multiple-scale, high- automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters. Dan North, Agile Testing, Specifications and BDD Exchange 20095
    • BDD: An attempt to fit it all together Specification by TDD Example Test Driven Development Definition of Done DDD Domain Driven Design BDD Behavior Driven ATDD DSL Development Acceptance Test Driven DevelopmentDomain Specific Language Outside-In User Stories Development 6
    • Specification by Example • Abstract requirements and specifications are not a good tool for communication. • Concrete examples are much better. • Usually examples are not formalized and not shared. are composed ofExamples Tests elaborate verify & validate Requirements Books by Gojko Adzic7
    • Detail Discussions… We want to encourage new users to place an order. Therefore we are going to offer 10% discount on every initial order. Register as “bart_bookworm” Go to “/catalog/search” Enter “ISBN-0955683610” Click “Search” Click “Add to Cart” Click “View Cart” Verify “Subtotal” is “$33.75” public void CalculateDiscount(Order order) { if (order.Customer.IsNew) order.FinalAmount = Math.Round(order.Total * 9/10); }8
    • … Illustrated with Examples Given a user who hasnt placed an order yet When the user puts a book into the shopping cart Then a discount of 10% should be applied on the cart total.9
    • Show Implicit Expectations Actually, this is not quite right: books on sale should be excluded from discount.10
    • 3 Amigos Exceptional, Happy Feasibility Edge Cases Path11
    • TDD12
    • ATDD: Rising the Level of Abstraction13
    • Outside-In Development• Always start with a Story• What development should focus on: •Providing business value •Satisfying stakeholder needs 1 •Software that matters 2 3 •Consumable software 4 514
    • BDD: An attempt to fit it all together Specification by TDD Example Test Driven Development Definition of Done DDD Domain Driven Design BDD Behavior Driven ATDD DSL Development Acceptance Test Driven DevelopmentDomain Specific Language Outside-In User Stories Development 15
    • SpecFlow• Open-source BDD tool for .NET www.specflow.org • www.specflow.org • github.com/techtalk/SpecFlow• Focus on high level behavior: features / acceptance tests• Focus on story-style plain text specifications• Using Gherkin as DSL for specifications• Uses existing testing frameworks for execution (Nunit, MSTest, xUnit) • VisualStudio / Build integration16
    • SpecFlow History• Founded in late 2009 by TechTalk www.specflow.org• Goals: • A pragmatic BDD tool for .NET • Provide a frictionless experience for .NET environments • Use existing tools: VisualStudio, UnitTest- Frameworks• SpecFlow is now used in most projects by TechTalk• SpecFlow is used all over the world.18
    • 19
    • Integrations… MSBuild MSTest20
    • ContributorsJonas Bandi, Darren Cauthon, ChristianHassa, Gaspar Nagy, Dale RaganVagif Abilov, Jon Archer, Xerxes Battiwalla,Ryan Burnham, Matt Ellis, Csaba Gerő,John Gietzen, Marcus Hammarberg, KerryJones, Mátyás Kabódi, Avram Korets,Viktor Nemes, Max Paulousky, Chris Roff,Daniel Sack, Attila Sztupák, Charles Weld,Steven Zhang21
    • DEMO22
    • http://www.stackoverflow.com tag: specflow “haacked” Phil Haack ASP.NET MVC: A New Framework for Building Web Applications “forked”DEMO23
    • MonoDevelop Integrationby Dale Ragandale.ragan@sinesignal.comTwitter: @dwragan 24
    • Teaser Session 2 Requirements Analysis Executable & Automated Specifications Improving Feedback with a Transparent Development Process Living Documentation25
    • Other BDD Sessions at the NDCThursday Morning:• Gojko Adzic• Scott Bellware 26
    • Questions &Discussion GASPAR NAGY JONAS BANDI gaspar.nagy@techtalk.at jonas.bandi@techtalk.ch Twitter: @gasparnagy Twitter: @jbandi COPYRIGHT 2011, TECHTALK - WWW.TECHTALK.CH
    • OtherInterpretations of BDD COPYRIGHT 2011, TECHTALK - WWW.TECHTALK.CH
    • BDD? – Bushido Driven Development Write good code or kill yourself out of shame. @durp29
    • Boss Driven Development Beer Driven Development30
    • Ah ok... I understand. It is done!"BDD? – What? What do you mean?"Bug Driven Well it is done. The system is finished! Well, no ... I dont see an icon where I can start it?Devel- I want you to build YouInstant Social Turbo Oh! an are right. Thats a bug! I will fix it!opment Communication Workstation Terminal ... five minutes later ... Ok, the icon is here. Now it is done! But when I double-click the icon nothing happens! Oh! You are right. That’s a bug! I will fix it. ... five minutes later ... Ok, the app starts when you double click. Now31 it is done!"