Test Driven Development with Java

1,158 views
1,057 views

Published on

Test Driven Development with Java.

Presentation given by Edouard SWIAC the 15/12/2010 at SUPINFO San Francisco.

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
1,158
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Test Driven Development with Java

    1. 1. Test-driven development with Java Edouard SWIAC Java Lab SF - javalabsf@googlegroups.com
    2. 2. Summary• Principles• Mocks and stubs• TDD example
    3. 3. repeittion of very What is TDD ?short dev cycle of 3stepstest come from storyrefactorchanging sourcewithout modifyingexternal functional Software development process in 3 stepsbehavior
    4. 4. because you have to design thecomponent before you code, TDD in shortand note design the componentwhile you code • Encourages simple design (Ken Beck) • Relies on automated unit testing • Builds a harness against software regression
    5. 5. although required,dependencies and Testing and collaboratorscollaborators needs to bereplace by somethin • Testing a unit of code is not testing its collaborators • Collaborators have to be reproduced and controlled to produce expected results so tests can run => enter mocks !
    6. 6. Stubs and mocks stub on existing code or yet to be code mock help to test behavior• A stub (or method stub) returns programmed results when called• A mock (or mock object) mimics a real object. It has the same interface as the real objects it mimics.• Mocks methods can be stubbed
    7. 7. TDD in action• Demo !
    8. 8. More information• Article: Mocks aren’t stubs (M. Fowler)• Wikipedia: TDD• Agile manifesto
    9. 9. Thank you !• Questions ?• Java lab mailing list: javalabsf@googlegroups.com

    ×