0
Test-Driven DevelopmentLet the tests be your guide
It startswiththe test
Benefits of TDD¡  All the benefits of unit testing plus …¡  It becomes hard to create errors in the first place  ¡  You...
Red,            green,           refactor¡  asdf
The red phase
You want to write positivetests and negative tests¡  Negative tests involve values that are outside    acceptable ranges....
The greenphase
The refactoringphase
Once finished you pick up auser story and start againwriting a new failing test
Refactoring example
Summary¡  Unit testing is the cornerstone of TDD¡  TDD = Red, green, refactor¡  Red = write a failing unit test¡  Gree...
Upcoming SlideShare
Loading in...5
×

Tdd let the tests be your guide.pptx

382

Published on

How TDD is done

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

  • Be the first to like this

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

No notes for slide

Transcript of "Tdd let the tests be your guide.pptx"

  1. 1. Test-Driven DevelopmentLet the tests be your guide
  2. 2. It startswiththe test
  3. 3. Benefits of TDD¡  All the benefits of unit testing plus …¡  It becomes hard to create errors in the first place ¡  You almost have to try to create errors¡  Better matches the business requirements¡  It does what it is supposed to do ¡  It must because we only write tests that satisfy requirements¡  Encourages communication with the business¡  It eliminates gold plating
  4. 4. Red, green, refactor¡  asdf
  5. 5. The red phase
  6. 6. You want to write positivetests and negative tests¡  Negative tests involve values that are outside acceptable ranges. ¡  They should fail ¡  Youre testing to make sure that they do¡  Positive tests are ones that should pass
  7. 7. The greenphase
  8. 8. The refactoringphase
  9. 9. Once finished you pick up auser story and start againwriting a new failing test
  10. 10. Refactoring example
  11. 11. Summary¡  Unit testing is the cornerstone of TDD¡  TDD = Red, green, refactor¡  Red = write a failing unit test¡  Green = make the unit test pass using a naïve implementation¡  Refactor = improve the code quality¡  TDD results in huge benefits like better quality code that better matches the business requirements, encourages communication and eliminates gold plating
  1. A particular slide catching your eye?

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

×