Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
TDD & S.O.L.I.D.Two ingredients for high-quality software<br />Dennis Doomen<br />dennis.doomen@avivasolutions.nl<br />
About Me<br />Principal Consultant at Aviva Solutions<br />35 years<br />6-month daughter<br />12 years of experience<br /...
Agenda<br />About quality<br />Test Driven Development & S.O.L.I.D<br />Demos & examples<br />Guidelines to get started<br />
What is quality?<br />Or, how do you measure it?“I don&apos;t care howgoodyouthinkyour design is. If I can&apos;t walk in ...
How?<br />Use coding guidelines<br />Apply common design principles<br />Test Driven Development<br />Refactoring<br />Use...
Test Driven Development<br />Is a design process<br />Tests are your first users<br />Tests can be your documentation<br /...
S.O.L.I.D.<br />Single ResponsiblityPrinciple<br />Open ClosedPrinciple<br />LiskovSubstitutionPrinciple<br />Interface Se...
Demo<br />Attendee registration<br />TDDSingle Reponsibility Principle<br />Dependency Inversion Principle<br />
What you have seen<br />TDD<br />Arrange-Act-Assert<br />Red-Green-Refactor<br />Mocking<br />Intention revealing tests<br...
Phases of unit testing<br />Refusing<br />Getting too excited<br />Testing everything!<br />Integration testing<br />Disco...
Example<br />Types of attendees<br />Open Closed Principle<br />Dependency Inversion Principle<br />
Naive Solution<br />
Better Solution<br />
Best Solution<br />
What you have seen<br />Open Closed Principle<br />Single Responsibility Principle<br />Dependency Inversion Principle<br ...
Example<br />Billing<br />Liskov Substitution Principle<br />
Naive Solution<br />
Better Solution<br />new EmployeeBuilder().Build() ??<br />
Best Solution<br />
What you have seen<br />Liskov Substition Principle<br />Single Responsibility Principle<br />
Example<br />Event listening<br />Interface seggregation<br />
Naive Solution<br />
Better Solution<br />
Best Solution<br />
What you have seen<br />Interface Seggregation<br />
Getting started guidelines<br />Test should be<br />Small and focused<br />Intention revealing<br />Repeatable<br />Have n...
Getting started guidelines<br />Mocking<br />Don&apos;t mock chatty interfaces<br />Don&apos;t have more than 2-3 mocks pe...
Resources<br />xUnit Patternshttp://xunitpatterns.com/<br />Applying Domain Driven Design and Design Patternshttp://www.am...
Q&A<br />Emaildennis.doomen@avivasolutions.nl<br />Blogwww.dennisdoomen.net<br />Twitterwww.twitter.com/dennisdoomen<br />
TDD and S.O.L.I.D.; Two Ingredients For High Quality Software
Upcoming SlideShare
Loading in …5
×

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

5,694 views

Published on

Published in: Technology, Business
  • Thanks for this. Is there any source code available?
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

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

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

×