1 / 23

Behavior driven development

Nathaniel Neitzke Lighthouse1, LLC nightski@gmail.com. Behavior driven development. Test driven development. Where did it come from? What is it?. Why automated tests?. To verify correctness?. Confidence. Ability to change. Isolation. Debugging is hard, time consuming. Design. BDUF

sydney
Download Presentation

Behavior driven development

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Nathaniel Neitzke Lighthouse1, LLC nightski@gmail.com Behavior driven development

  2. Test driven development Where did it come from? What is it?

  3. Why automated tests? • To verify correctness?

  4. Confidence • Ability to change

  5. Isolation • Debugging is hard, time consuming

  6. Design • BDUF • Goldplating

  7. Documentation • What does this code do?

  8. Testability • Send quality code to QA

  9. So what’s wrong with tdd? • Focus on tests so it must be testing right? • Sapir-Whorf

  10. The problem with “unit” • What is a unit? • Unit test -> class

  11. Programmers think… • I’m not going to write all those tests • It’s really simple code, it doesn’t need to be tested • Testing is a waste of time • I’ve done this all a million times (loops, data retrieval, functionality, etc…)

  12. Manager’s think… • We test after the code is done • That’s what we have a testing person for • We can’t spend that time now

  13. Behavior driven development • TDD done very well • Not about tests • Think differently • Dan North/AslakHellesøy 2004

  14. Specifications • Executable specifications around the behavior of your system

  15. User stories • Conversation between customer and developer • Drive our executable specifications • Role, feature, benefit • As a [role] I want [feature] so that [benefit]

  16. Scenarios • Detail acceptance criteria for a particular user story • Context – Action – Observation • Given [Context] When [Action] Then [Observation]

  17. Format Title (one line describing the story) Narrative: As a [role] I want [feature] So that [benefit] Acceptance Criteria: (presented as Scenarios) Scenario 1: Given [context] And [some more context]… When [event] Then [outcome] And [another outcome]…. Scenario 2: ….

  18. rspec & cucumber • Frameworks/Tools

  19. DEMO

  20. .NET Frameworks • NBehave, • .NETSpec • Machine.Specifications

  21. Other Tools • TextMate/e • Autotest • Heckle • Rake • RCov

  22. Resources • Dan North • http://dannorth.net/introducing-bdd • http://dannorth.net/whats-in-a-story • RSpec • http://rspec.info/ • Cucumber • http://cukes.info/ • IronRuby • http://www.ironruby.net/ • Beyond Test Driven Development Video • http://video.google.com/videoplay?docid=8135690990081075324 • The RSpec Book: BDD with RSpec, Cucumber, etc.. • http://www.pragprog.com/titles/achbd/the-rspec-book

  23. Questions?

More Related