Test Driven Development

775 views

Published on

This was one of my first presentations that I gave in Columbus, Ohio at an event called "Day of .Net"

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
775
On SlideShare
0
From Embeds
0
Number of Embeds
29
Actions
Shares
0
Downloads
51
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Test Driven Development

  1. 1. Test Driven Development Ben Carey NuSoft Solutions
  2. 2. The Presentation <ul><li>What is TDD? </li></ul><ul><li>How do I do it? </li></ul><ul><li>Why do it? </li></ul><ul><li>Lessons learned </li></ul><ul><li>Resources </li></ul><ul><li>Q&A </li></ul><ul><li>What do you want to talk about? </li></ul><ul><ul><li>(please interrupt) </li></ul></ul>
  3. 3. What is TDD? <ul><li>Writing clean code that works </li></ul><ul><li>The use of testing for… </li></ul><ul><ul><li>Automated Feedback </li></ul></ul><ul><ul><li>Incremental Design </li></ul></ul><ul><li>It’s more than just unit testing </li></ul><ul><ul><li>Developer Tests </li></ul></ul><ul><ul><li>Functional Tests </li></ul></ul><ul><ul><li>Performance Tests </li></ul></ul><ul><ul><li>Regression Tests </li></ul></ul><ul><ul><li>Design in the context of today’s problem </li></ul></ul>
  4. 4. What is TDD?
  5. 5. How do I do it? <ul><li>Think about what you want to do. </li></ul><ul><li>Think about how to test it. </li></ul><ul><li>Write a small test. </li></ul><ul><li>Watch it fail. </li></ul><ul><li>Write enough code to watch it pass. </li></ul><ul><li>Refactor </li></ul><ul><ul><li>Once and only once </li></ul></ul><ul><ul><li>DRY </li></ul></ul><ul><li>Repeat </li></ul>
  6. 6. How do I do it? <ul><li>Demo </li></ul>
  7. 7. Why do it? <ul><li>Feedback </li></ul><ul><ul><li>Know what works </li></ul></ul><ul><ul><li>Know what doesn’t work </li></ul></ul><ul><ul><li>Change things (and know if it worked) </li></ul></ul>
  8. 8. Why do it? <ul><li>Communication </li></ul><ul><ul><li>Executable documentation </li></ul></ul><ul><ul><ul><li>It’s always up to date </li></ul></ul></ul><ul><ul><ul><li>How many of your requirements / design documents can be proven? </li></ul></ul></ul><ul><ul><ul><li>Give new team members code instead of word documents </li></ul></ul></ul><ul><ul><li>Demonstrate intent </li></ul></ul><ul><ul><li>Show usage </li></ul></ul>
  9. 9. Why do it?
  10. 10. Why do it? <ul><li>Simplicity </li></ul><ul><ul><li>Organic Architecture </li></ul></ul><ul><ul><li>Empathetic code </li></ul></ul><ul><ul><li>We (by habit) over-engineer our code </li></ul></ul><ul><ul><li>Keep architecture / design in proportion to today's needs </li></ul></ul><ul><ul><li>Design based on feedback / experience </li></ul></ul>
  11. 11. Why do it? <ul><li>Courage vs. Fear </li></ul><ul><ul><li>What are the implications of this change? </li></ul></ul><ul><ul><li>Did I break anything? </li></ul></ul><ul><ul><li>Trust </li></ul></ul>
  12. 12. Lessons Learned <ul><li>Readable trumps well-factored </li></ul><ul><li>Red / Green / Refactor = Flow </li></ul><ul><li>Defects – Prove it, then fix it (forever) </li></ul><ul><li>Adopt multiple levels of testing </li></ul><ul><li>The 10 minute rule </li></ul><ul><li>Use Mock objects </li></ul>
  13. 13. Good Stuff <ul><li>Test Driven Development: By Example </li></ul><ul><li>Test-Driven Development in Microsoft .Net </li></ul><ul><li>Pragmatic Unit Testing in C# with NUnit </li></ul><ul><li>www.testdriven.com </li></ul><ul><li>www.testingreflections.com </li></ul><ul><li>www.c2.com </li></ul>
  14. 14. The End <ul><li>Contact Info: </li></ul><ul><li>Ben Carey </li></ul><ul><li>[email_address] </li></ul><ul><li>NuSoft Solutions </li></ul><ul><li>614-607-3754 </li></ul>

×