Test driven development
Upcoming SlideShare
Loading in...5
×
 

Test driven development

on

  • 405 views

 

Statistics

Views

Total Views
405
Views on SlideShare
405
Embed Views
0

Actions

Likes
0
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Test driven development Test driven development Presentation Transcript

  • Test Driven Development Marcelo Cure
  • Where did it come from? • Kent Beck in 2003 • Concepts related to Extreme Programming
  • What’s TDD? • Development technique • Focus on quality • First test then code • Requirements before code • Based on cycles
  • 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
  • Benefits • More tests, less bugs • Code quality • Rare necessity to debug • Leads to modularize your system • Big coverage
  • Limitations • Management support is required • Fake tests • Are we really doing TDD?
  • Environment (talking about Java) • Java • Eclipse • JUnit
  • Examples – NameRetriever
  • NameRetrieverTest public class NameRetrieverTest { private NameRetriever nameRetriever; @Test public void testRetrieveName() { String name = nameRetriever.retrieveName(); Assert.assertEquals("cure", name); } }
  • NameRetriever public class NameRetriever { public String retrieveName() { return ""; } }
  • NameRetriever public class NameRetriever { public String retrieveName() { return "cure"; } }
  • NameRetrieverTest public class NameRetrieverTest { private NameRetriever nameRetriever; @Test public void testRetrieveName () { Assert.assertEquals("cure", nameRetriever.retrieveName()); } }
  • That’s all, thanks!