Your SlideShare is downloading. ×
0
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Driving application development through behavior driven development
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Driving application development through behavior driven development

1,102

Published on

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

No Downloads
Views
Total Views
1,102
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
25
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

    1. Driving application development throughBehavior Driven Development by Einar Ingebrigtsen
    2. Who am I? Consultant DoLittle Studios Silverlight MVP einar@dolittle.com twitter.com/einari http://www.ingebrigtsen.info
    3. Who am I?Author of Balder - 3D engine for Silverlighthttp://balder.codeplex.comCo-author of Bifrost - enterprise app frameworkhttp://bifrost.dolittle.comCo-author of Forseti - headless JS test runnerhttp://github.com/dolittlestudios/forseti
    4. Win a Typemock Isolator / Isolator++ License During the webinar, tweet one cool takeaway or one tip that you learn with the hashtag #unittesting and @typemock. Typemock will then choose a winner and announce them next week.
    5. Retro-style testing, 1996
    6. 9 phases of unit testing• What is unit testing?• Refuse to unit test because “you don’t have enough time”.• Fight it because it means writing more code• Start unit testing and start blogging / talking about unit testing and TDD and how great it is• Unit test everything - make private methods internal and abuse things like InternalVisibleTo attribute. 100% codecoverage is the only way to fly• Discover mocking and abuse it• Mock everything that is possible to be mocked (like the entire .net framework)• Start writing effective tests• Enjoy others trying to figure out why you hardly have any bugs at all
    7. Why• Improve quality• Add predictability• Add changeability• Safety net
    8. Test first “One of the most useful times to write tests is beforeyou start programming. When you need to add a feature, begin by writing the test. By writing the test you are asking yourself what needs to be done.” Martin Fowler
    9. Continuous• Your tests are worthless without them being executed at a certain frequency• Integrate your tests and production code often and have your tests along with others run frequently
    10. The 10th phase
    11. ... orskip all 9...
    12. Lets talk about behaviors...
    13. Background• Coined by Dan North in 2006 article in Better Software magazine• Reaction to TDD• Focus on behaviors of your system
    14. Dialogue• Improves the dialog with non-developers• Mindset puts the developer closer to business value• Easier for other developers to read• Easier to get started with testing
    15. Mindset• Focus on business value; hence behavior in the system• Your system doesn’t work with data - but behavior that might result in data
    16. Where does it apply?• In short; everywhere• It fits perfectly for anything ranging from acceptance to unit level• In fact; you might want to stribe towards using BDD consistently
    17. Gherkin• Business readable DSL• Introduced by Aslak Hellesøy for Cucumber in 2008
    18. GherkinFeature: Addition In order to avoid silly mistakes As a math idiot I want to be told the sum of two numbersScenario: Add two numbers Given I have entered 50 into the calculator And I have entered 70 into the calculator When I press add Then the result should be 120 on the screen
    19. GherkinFeature: Addition In order to avoid silly mistakes As a math idiot I want to be told the sum of two numbersScenario: Add two numbers Given I have entered 50 into the calculator And I have entered 70 into the calculator When I press add Then the result should be 120 on the screen
    20. Units• Test behavior of the unit• Tests interaction between systems• Focus on decoupling
    21. Test Doubles• Provide implementations of dependent systems that are not real systems• Good for decoupling
    22. Fakes• Working implementations• Usually takes shortcuts unsuitable for production • In-memory database representations
    23. Stubs• Provide canned answers• May record information about calls being made to it
    24. Mocks• Objects preprogrammed with expectations• Often created adhoc by utilizing frameworks : • TypeMock • RhinoMocks • Moq • ... and more ...
    25. Writing testable code• Apply practices such as dependency inversion principle • Makes your code decoupled from real implementations• In short - S.O.L.I.D. prinicples will get you there...
    26. This changes everything
    27. do e sn’tThis changes everything
    28. Writing testable code• Your code will change - but its a good thing, its not only for your tests!• The principles that can be applied are good software development principles, regardless of testing or not
    29. Frameworks?• You can use your existing - remember; its a mindset, not a framework!• NBehave• MSpec
    30. Structure(project to specify).Specs (namespace) for_(unit to specify) given a_(context).cs when_(behavior to specify).cs
    31. Structure sample Bifrost.SpecsCommands for_CommandContext given a_command_context_for_a_simple_command_with_one_tracked_object.cs when_committing.cs
    32. Frameworks• SpecFlow• StoryQ• Cuke4Nuke
    33. Feedback Loop• Built-in test runner in Visual Studio is slow• TestDriven.net - great alternative• Auto-test running • Mighty Mooze - Continuous Test http://continuoustests.com/ • NCrunch http://www.ncrunch.net/
    34. Recommended reading• Dan Norths blog http://dannorth.net/introducing-bdd/• http://pragprog.com/book/hwcuc/the-cucumber-book The Cucumber book• The RSpec book http://pragprog.com/book/achbd/the-rspec-book
    35. .. one more thing ..
    36. .. go and create software with less bugs.. :)

    ×