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.

Add TDD to your Toolbox: an introduction to TDD

970 views

Published on

Introduction to TDD, test-driven development. Not included is a live coding demonstration of TDD in practice. Look at the link on the last slide for videos of other people doing TDD.

Published in: Technology
  • Be the first to comment

Add TDD to your Toolbox: an introduction to TDD

  1. 1. Add TDD to your toolbox an introduction for beginners Audrey Troutt @auditty
  2. 2. What is TDD? Test-Driven Development Audrey Troutt @auditty
  3. 3. Audrey Troutt @auditty Three conditions to achieve a flow state: 1. clear set of goals and progress 2. clear and immediate feedback 3. confidence in one's ability Csikszentmihalyi, M.; Abuhamdeh, S. & Nakamura, J. (2005), "Flow", in Elliot, A., Handbook of Competence and Motivation
  4. 4. “TDD is dead. Long live testing.” -David Heinemeier Hansson Read more: http://bit.ly/1foLebI Audrey Troutt @auditty
  5. 5. Materials needed: Source code Unit testing framework Understanding of requirements Audrey Troutt @auditty
  6. 6. Simple Case: There’s a bug Audrey Troutt @auditty
  7. 7. Use Case: From the Ground Up Audrey Troutt @auditty
  8. 8. “As the tests get more specific, the code gets more generic.” -Uncle Bob Martin Read more: http://bit.ly/1Bs2h70 Audrey Troutt @auditty
  9. 9. ● ({}–>nil) no code at all->code that employs nil ● (nil->constant) ● (constant->constant+) a simple constant to a more complex constant ● (constant->scalar) replacing a constant with a variable or an argument ● (statement->statements) adding more unconditional statements. ● (unconditional->if) splitting the execution path ● (scalar->array) ● (array->container) ● (statement->recursion) ● … and so on Read more: http://bit.ly/1Bs2h70 Audrey Troutt @auditty
  10. 10. Pros: ● More tests ● More testable code ● Discover missing requirements sooner ● Uncover novel designs ● Increased quality ● Refactor/add on with confidence ● Doesn’t generally take more time ● May start conversations Cons: ● First time setup of test framework takes extra time ● Not always practical (if requirements are not well defined) ● Makes changing object model harder ● May start conversations Audrey Troutt @auditty
  11. 11. “I credit TDD for teaching me how to test, and I still get huge benefits when I TDD. It’s not perfect, but no one technique is the key to magically producing better code.” -Justin Weiss Read more: http://bit.ly/1BVRR1y Audrey Troutt @auditty
  12. 12. Practice http://codekata.com/ Learn from others http://katas.softwarecraftsmanship.org/ Audrey Troutt @auditty

×