1 / 11

TDD by example

TDD by example. Pierre-Emmanuel DAUTREPPE – October 26th 2012. Why shall we test ? What is TDD (Test Driven Development ) ? Let’s practice it together doing a kata. Pierre-Emmanuel DAUTREPPE. « .NET Architect » and « XP Coach » Founder of User Group «  DotNetHub  »

kacy
Download Presentation

TDD by example

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. TDD by example Pierre-Emmanuel DAUTREPPE – October 26th 2012 Whyshallwe test ? Whatis TDD (Test DrivenDevelopment) ? Let’s practice ittogetherdoing a kata...

  2. Pierre-Emmanuel DAUTREPPE • « .NET Architect » and « XP Coach » • Founder of • User Group « DotNetHub » • « La Journée Agile »/« Agile Tour Namur » • Me contacter via : • pierre@dotnethub.be • http://www.pedautreppe.com • http://www.dotnethub.be • @pedautreppe

  3. Our developer life We = developers commentedit documentedit Turk et De Groot • That functionalityyouimplemented, you have ? • No, that’suseless ! It’s trivial ! • … • … • … doesn’twork … • ???? testedit n00b We are genious ! (generallymisunderstood)

  4. Our developer life

  5. Our developer life Just use a safetynet ! PinderCircus

  6. Tests are a validation tool…

  7. …but also a documentation tool… It’swritten « Sort out yourownproblems ! » Hereis a prettyclearuser manual

  8. …and a design tool

  9. The « Test DrivenDevelopment » Cycle • Write a test • Refactoring of tests • Refactoring • It does not compile • Refactoringof code • Test passes • Writeneeded API • Implement • Test compiles • but fail

  10. Conclusion • Follow the TDD rules • Be iterative: split yourwork in small (requirement) increments • Alwaysstart by writing a test • Thenimplementuntill the test passes • And Cleanup! (refactor) • TDD let you use tests as • A validation tool • A documentation tool • A design tool

More Related