• Like
TDD and S.O.L.I.D.; Two Ingredients For High Quality Software
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

TDD and S.O.L.I.D.; Two Ingredients For High Quality Software

  • 3,078 views
Published

 

Published in Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
3,078
On SlideShare
0
From Embeds
0
Number of Embeds
3

Actions

Shares
Downloads
59
Comments
0
Likes
1

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
  • PROVIDE YOU SESSION CODE AND NAME AS IT WAS DEFINED BY AGENDA OWNERS.WELCOME ATTENDEES. INTRODUCE YOURSELF AND YOUR SESSION.
  • PROVIDE 5 MIN BEFORE SESSION ENDS FOR Q&A.

Transcript

  • 1. TDD & S.O.L.I.D.Two ingredients for high-quality software
    Dennis Doomen
    dennis.doomen@avivasolutions.nl
  • 2. About Me
    Principal Consultant at Aviva Solutions
    35 years
    6-month daughter
    12 years of experience
    C++ origins
    On .NET since 2001
  • 3. Agenda
    About quality
    Test Driven Development & S.O.L.I.D
    Demos & examples
    Guidelines to get started
  • 4. What is quality?
    Or, how do you measure it?“I don't care howgoodyouthinkyour design is. If I can't walk in and write a test foranarbitrarymethod of yours in fiveminutes, itsnot as good as youthinkit is, and whetheryouknowitornot, you'repaying a pricefor it.”Michael Feathers, ObjectMentor
  • 5. How?
    Use coding guidelines
    Apply common design principles
    Test Driven Development
    Refactoring
    Use Design Patterns
    Pair Programming
    Socialize design & architecture
  • 6. Test Driven Development
    Is a design process
    Tests are your first users
    Tests can be your documentation
    If TDD hurts then you're doing it wrong
  • 7. S.O.L.I.D.
    Single ResponsiblityPrinciple
    Open ClosedPrinciple
    LiskovSubstitutionPrinciple
    Interface SeggregationPrinciple
    DependencyInversionPrinciple
  • 8. Demo
    Attendee registration
    TDDSingle Reponsibility Principle
    Dependency Inversion Principle
  • 9. What you have seen
    TDD
    Arrange-Act-Assert
    Red-Green-Refactor
    Mocking
    Intention revealing tests
    Single Responsibility Principle
    Dependency Inversion Principles
  • 10. Phases of unit testing
    Refusing
    Getting too excited
    Testing everything!
    Integration testing
    Discover mocking
    Mocking everything
    Becoming effective
  • 11. Example
    Types of attendees
    Open Closed Principle
    Dependency Inversion Principle
  • 12. Naive Solution
  • 13. Better Solution
  • 14. Best Solution
  • 15. What you have seen
    Open Closed Principle
    Single Responsibility Principle
    Dependency Inversion Principle
    Chain of Responsibility Pattern
    Factory Method Pattern
  • 16. Example
    Billing
    Liskov Substitution Principle
  • 17. Naive Solution
  • 18. Better Solution
    new EmployeeBuilder().Build() ??
  • 19. Best Solution
  • 20. What you have seen
    Liskov Substition Principle
    Single Responsibility Principle
  • 21. Example
    Event listening
    Interface seggregation
  • 22. Naive Solution
  • 23. Better Solution
  • 24. Best Solution
  • 25. What you have seen
    Interface Seggregation
  • 26. Getting started guidelines
    Test should be
    Small and focused
    Intention revealing
    Repeatable
    Have no side-effects
    Independent
    Test what you know now (and assemble the rest from those pieces)
  • 27. Getting started guidelines
    Mocking
    Don't mock chatty interfaces
    Don't have more than 2-3 mocks per test
    Only mock your nearest neigbors
    Keep your tail short
    Isolate the ugly stuff
    Conform to SOLID (and other principles)
  • 28. Resources
    xUnit Patternshttp://xunitpatterns.com/
    Applying Domain Driven Design and Design Patternshttp://www.amazon.com/Applying-Domain-Driven-Design-Patterns-Examples/dp/0321268202
    Jeremy D. Millerhttp://codebetter.com/blogs/jeremy.miller/default.aspxhttp://msdn.microsoft.com/en-us/magazine/cc720886.aspx
    InfoQ Recommended TDD Tutorialshttp://www.infoq.com/news/2009/05/recommended-tdd-tutorials
    Los Techies S.O.L.I.D. Principles E-Bookhttp://www.lostechies.com/content/pablo_ebook.aspx
    C# 3.0 Coding Guidelineshttp://blog.avivasolutions.nl/archive/2009/03/06/new-coding-guidelines-for-c-3-0.aspx
  • 29. Q&A
    Emaildennis.doomen@avivasolutions.nl
    Blogwww.dennisdoomen.net
    Twitterwww.twitter.com/dennisdoomen