Published on

Behavior driven development

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide


  1. 1. Presented By:Rajesh Kumar
  2. 2. What is Behaviour Driven DevelopmentWhy BDD?• Business Value?Selling BDD to BusinessTechnical Perspective: BDD v/s TDDImplementation Techniques• Jdave• EasybEvaluate Business Values Concept of BDD Rajesh Kumar 12 August, 2011
  3. 3. Customer Developer TesterConcept of BDD Rajesh Kumar 12 August, 2011
  4. 4. I HOPE YOU GET COMFORTABLE WITH BDD AS THIS GUY IS EVERYTHINGConcept of BDD Authors name 12 August, 2011
  5. 5. Why are you laughing?Concept of BDD Rajesh Kumar 12 August, 2011 Confidential
  6. 6. But Seriously,Concept of BDD Rajesh Kumar 12 August, 2011 Confidential
  7. 7. Why Business should care? • The exponential change curve. MONEY We Fear This…So, we do this… TIME
  8. 8. What does Business Want? • Deliver features, or capabilities • Prioritise often, change often • Only focus on high-value features • Listen to Business Owners FeedbackWhat does BusinessCare about?• Outcomes• Cost• Risk• Certainty
  9. 9. BDD Behaviour Driven DevelopmentSOLUTION IS
  10. 10. • BDD = DDD + TDD• BDD builds on top of Test DrivenDevelopment• BDD = TDD Version 2
  11. 11. • BDD is all about behaviour. • Deliver Stake Holder Value.Business Explanation:BDD
  12. 12. In Order to increase the sale of my product As a product owner I want to see ................Story Description – JIRA, WIKI, Word somewhere..
  13. 13. ArrayList<Object> objectList = get Object(); If(! objectList .get(0).getName().equals(“du mmy”)) Fail();Automated Junit and Acceptance test cases.
  14. 14. 1. Login to Dashboard 2. Use Account which has international favourites Bolt On 3. Go to Add Bolt On Screen and check if International favourites appears on top of Bolt On Categories.Test Procedures
  15. 15. In Order to increase the sale of Internationalfavourites Bolt OnAs a product ownerI want to see International Favourite Bolt On tobe displayed at the beginning of Bolt On page.
  16. 16. • BDD is all about behaviour. • Deliver Stake Holder Value.Business Explanation:BDD
  17. 17. I waste less time and money building things that aren’t Reduce Waste really needed and uncovering value helps me to prioritize properly. Fantabulous!!!! Dead Specifications: slipped away, out of sight, out of mind. But now, Live behavioural specifications. Documentation on demand. Amazing!!!!Quicker feedback, a better chance of gettingwhat I need, more efficient development,Regression testing shared, faster andcheaper.Waowww!!!!
  18. 18. • The word “Test” in TDD is bit misleading. • It’s just not writing test cases • Design and write better code • Re-factor with confidence • It helps you to • create light weight design • express behaviour • keep an eye on code – to tell you if it begins to fall apartTest Driven Development
  19. 19. • Red, Green, Re-factor 1. Write a failing test 2. Write the smallest amount of production code possible to get that test to pass 3. Re-factor • Add more tests and write better production code.
  20. 20. Don’t forget to Think!
  21. 21. •Think, Red, Green, Re-factor 1. Thinking is really very important. 2. Problem: • TDD and nature of traditional tool often make it harder to think about what we are trying to do.
  22. 22. • Unit tests are exclusive toprogrammer domain. 1. Bad for agile because we lose the customer-centric nature of agile. 2. TDD tends to be associated with isolate tests. Not integration tests. 3. A lot gets lost in translation due to unit tests which leads to loss of focus and decreased productivity.
  23. 23. BDD explicitly defines things that TDDleaves unclear or undefined. BDD = TDD 2.0• BDD bridges the gap between specs/requirements and actual implementation.• Programmer goals and priorities are more clearly aligned with requirements because BDD is implemented in business language.
  24. 24. We start at the outside anddrill down, inwards towardsunit and functional tests BDD (integration tests) TDD (unit/functional tests) BDD (integration tests)
  25. 25. Is it to test code or describe behavior??BOTHTDD is about ensuring behaviour.BDD is about describing behaviour.
  26. 26. • Yes, we can!• Is it ideal? Not really.. • Lots of boiler-plate code • Long method names • Cumbersome asserts • Can we do better??
  27. 27. • Make tests clearer and easier to write.• Make tests self-documenting• Help developers focus on requirements.Choices:Cucumber: JRuby, Cuke4Duke, widely accepted, Eclipse, IntelliJ, Ant, gradle, CI.Easyb: groovy based, groovy DSL based to express BDD specifications, “Executable Requirements”, IntelliJ, Ant, gradle, CI.JDave: java based, extends JUnit yielding excellent IDE support, tight integration into mock objects, “TDD Done Right”
  28. 28. Outcomes: We implement stories, that make up features, that build the feature sets, that deliver the outcomes, and then we stop.Cost: Lets pay only for what we use, pay per feature beside pay per capability. Lets guarantee to stop when we are done.Risk: Project can not cost too much to finish, application can not do wrong thing, can not be unstable in production.Certainty: Lets measure results “the distance not the fuel”. Regular feedback, per release, per feature, per day
  29. 29. Better through put means happy customers.Better feedback means happier teams.Focus on results means less waste and less cost. It is not a silver bullet but it seems a good start.