why-tdd

522
-1

Published on

Presentation done

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

  • Be the first to like this

No Downloads
Views
Total Views
522
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

why-tdd

  1. 1. AMIR BARYLKO WHY TDD? WPG RUBY UG 2011Amir Barylko - TDD MavenThought Inc.
  2. 2. INTRO Why projects fail? Reality Check No more excuses Why TDD?Amir Barylko - TDD MavenThought Inc.
  3. 3. WHY PROJECTS FAIL? • Delivering late or over budget • Delivering the wrong thing • Unstable in production • Costly to maintainAmir Barylko - TDD MavenThought Inc.
  4. 4. REALITY CHECK • It is impossible to gather all the requirements at the beginning of a project. • Whatever requirements you do gather are guaranteed to change. • There will always be more to do than time and money will allow.Amir Barylko - TDD MavenThought Inc.
  5. 5. NO MORE EXCUSES • It works on my computer! • We need a satellite connection in order to • Itwas like that when I got run it! here! • We can’t reproduce the • The previous developer error! didn’t know XXXX! • We can’t test that!Amir Barylko - TDD Workshop PRDC 2011 MavenThought Inc.
  6. 6. WHY TDD? • Prove that your code • Regression tests as works byproduct • Avoid waste • Makechanges with (debugging) confidence • Increment code quality • Bring back the joy of coding! • Better designAmir Barylko - TDD Workshop PRDC 2011 MavenThought Inc.
  7. 7. APPLYING TDD Iteration 0 .. N Quality as a Driver Red - Green - RefactorAmir Barylko - TDD MavenThought Inc.
  8. 8. ITERATION 0 • Flush out architecture. • Setup Testing harness for TDD and BDD. • Setup continuous integration. • Setup scripts to build, deploy, etc. • Setup visual communication tools.Amir Barylko - TDD MavenThought Inc.
  9. 9. ITERATION 1.. N • Start by Story Planning • Pair programming (switching often) Every day! • Daily Scrum • End with RetrospectiveAmir Barylko - TDD MavenThought Inc.
  10. 10. QUALITY AS A DRIVER Red BDD Red Refactor Refactor TDD Green GreenAmir Barylko - TDD MavenThought Inc.
  11. 11. RED •Write a test that fails •Relax, is ok if it compilesAmir Barylko - TDD MavenThought Inc.
  12. 12. GREEN • Try to make the test pass • Do a simple solution • Use default values (not throwing exceptions) • Don’t worry if the code “smells”Amir Barylko - TDD MavenThought Inc.
  13. 13. REFACTOR • Avoid repeating code • Avoid hardcoding dependencies • Avoid “write only” code • Refactor with confidence! • Run all tests if possibleAmir Barylko - TDD MavenThought Inc.
  14. 14. DEMO MediaLibrary Add Top10Amir Barylko - TDD MavenThought Inc.
  15. 15. SUMMARY Limits Benefits Challenges AdoptionAmir Barylko - TDD MavenThought Inc.
  16. 16. LIMITS OF TDD • Unit test • Integration test • Acceptance testAmir Barylko - TDD MavenThought Inc.
  17. 17. BENEFITS • Let the methodology drive • It will save your bacon! • High quality the whole way! • Very few bugs! • Do your duty as developer!Amir Barylko - TDD MavenThought Inc.
  18. 18. CHALLENGES • Very different from conventional testing • Many developers find it complex to learn at first • Hard to start without a Mentor • Management buy in • Difficult to keep under deadline pressure • Beware of code coverage!Amir Barylko - TDD MavenThought Inc.
  19. 19. ADOPTION • Find Mentor/Couch/Trainer • Small iterations • Have metrics ready (velocity, etc) • Do whatever works for you • Find out which tools will benefit you • Automate, automate, automate!Amir Barylko - TDD MavenThought Inc.
  20. 20. QUESTIONS?Amir Barylko - TDD MavenThought Inc.
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×