Avatars of Test Driven Development (TDD)

Embed Size (px)

DESCRIPTION

It's easy to speak of test-driven development as if it were a single method, but there are several ways to approach it. In my experience, different approaches lead to quite different solutions. In this hands-on workshop, with the help of some concrete examples, I'll demonstrate the different styles and more importantly what goes into the moment of decision when a test is written? And why TDDers make certain choices. The objective of the session is not to decide which approach is best, rather to highlight various different approaches/styles of practicing test-driven development. By the end of this session, you will understand how TTDers break down a problem before trying to solve it. Also you'll be exposed to various strategies or techniques used by TDDers to help them write the first few tests.

Text of Avatars of Test Driven Development (TDD)

  • 1.Avatars of TDDRule of DiversityDistrust all claims forOne True WayNaresh Jain naresh@agilefaqs.com @nashjainhttp://nareshjain.comCopyright 2013, AgileFAQs. All Rights Reserved.

2. Key QuestionsBusiness FacingAre we building the right product?Are we building the product right? Technology/Implementation Facing Copyright 2013, AgileFAQs. All Rights Reserved. 3. Brian Maricks Test Categorization Before/While Coding Post CodingBusiness FacingSupports Programming Critique product Technology/Implementation Facing Copyright 2013, AgileFAQs. All Rights Reserved. 4. It Helps to Think of Tests this way... Business Facing Acceptance Testing Exploratory TestingDrives DevelopmentCritique product Low- prototypesUI and Usability Testing Performance TestingUnit Testing System TestsTechnology/Implementation FacingCopyright 2013, AgileFAQs. All Rights Reserved. 5. Business FacingDrives DevelopmentInside OutCritique product Outside In Technology/Implementation FacingBrian Maricks Test Categorization 6. TDD RhythmTest, Code, Refactor Add a Test PassRun the Test FailMake a littlechangeFailRun the Test PassRefactor 7. Acceptance Test Driven DevelopmentIterationAutomatedAcceptanceAcceptance TestsPE Criteria RFORStory Automated M Unit TestET Automated UI NEC TestsSETSAutomatedAcceptance Tests AcceptanceExploratory CriteriaTesting Copyright 2013, AgileFAQs. All Rights Reserved. 8. Commercial Break! 9. Copyright 2013, AgileFAQs. All Rights Reserved. 10. Tech Talks! 11. It all started with...VeterinarianInformation SystemCopyright 2013, AgileFAQs. All Rights Reserved. 12. Outside In: ATDD Fitnesse Document: Assertions: 17 right, 0 wrong, 0 ignored, 0 exceptionscom.vis.billing.fixtures.PaidCashBill procedure details on the billaccount details namecostaccount number patient name owner name Routine Office Visit2501001 Fluffy Dave Atkins Rabies Vaccination50procedure details pay Cashnamecost patient name? owner name? account number? bill no? payment method? amount paid?Routine Office Visit250 FluffyDave Atkins 10011Cash300Rabies Vaccination50billcheckpaidtrueaccount number?owner name?patient name? total? paid?1001 Dave AtkinsFluffy300false check total 0 13. Outside In: Output 14. ATDD: Another ExampleAcceptance test:class FluffyTest < Test::Unit::TestCasedef test_examination_and_shotsvet = Veterinarian.newclinic = Clinic.new "Main Line health"dave = Owner.new "Dave"fluffy = Patient.new "Fluffy"dave.has fluffyvisit = clinic.visit(fluffy, vet) do |v|v.procedure "Rabies vaccination", 50endinvoice = visit.invoiceassert_equal invoice.to_s,