Your SlideShare is downloading. ×
Test driven development
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Test driven development

310
views

Published on

Published in: Technology, Business

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

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

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Test Driven Development Marcelo Cure
  • 2. Where did it come from? • Kent Beck in 2003 • Concepts related to Extreme Programming
  • 3. What’s TDD? • Development technique • Focus on quality • First test then code • Requirements before code • Based on cycles
  • 4. How does TDD work? • Developer must have the feature knowledge • Think baby steps • Write a failing test • Make it pass • Make sure it didn’t break any other test • Refactor • Loop
  • 5. Benefits • More tests, less bugs • Code quality • Rare necessity to debug • Leads to modularize your system • Big coverage
  • 6. Limitations • Management support is required • Fake tests • Are we really doing TDD?
  • 7. Environment (talking about Java) • Java • Eclipse • JUnit
  • 8. Examples – NameRetriever
  • 9. NameRetrieverTest public class NameRetrieverTest { private NameRetriever nameRetriever; @Test public void testRetrieveName() { String name = nameRetriever.retrieveName(); Assert.assertEquals("cure", name); } }
  • 10. NameRetriever public class NameRetriever { public String retrieveName() { return ""; } }
  • 11. NameRetriever public class NameRetriever { public String retrieveName() { return "cure"; } }
  • 12. NameRetrieverTest public class NameRetrieverTest { private NameRetriever nameRetriever; @Test public void testRetrieveName () { Assert.assertEquals("cure", nameRetriever.retrieveName()); } }
  • 13. That’s all, thanks!