add tdd to your toolbox: an introduction to tdd
DESCRIPTION
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.TRANSCRIPT
![Page 1: Add TDD to your Toolbox: an introduction to TDD](https://reader033.vdocuments.mx/reader033/viewer/2022051411/5476dcb5b4af9fd6028b4736/html5/thumbnails/1.jpg)
Add TDD to your toolboxan introduction for beginners
Audrey Troutt @auditty
![Page 2: Add TDD to your Toolbox: an introduction to TDD](https://reader033.vdocuments.mx/reader033/viewer/2022051411/5476dcb5b4af9fd6028b4736/html5/thumbnails/2.jpg)
Audrey Troutt @auditty
What is TDD? Test-Driven Development
![Page 3: Add TDD to your Toolbox: an introduction to TDD](https://reader033.vdocuments.mx/reader033/viewer/2022051411/5476dcb5b4af9fd6028b4736/html5/thumbnails/3.jpg)
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
![Page 4: Add TDD to your Toolbox: an introduction to TDD](https://reader033.vdocuments.mx/reader033/viewer/2022051411/5476dcb5b4af9fd6028b4736/html5/thumbnails/4.jpg)
“TDD is dead. Long live testing.” -David Heinemeier Hansson
Read more: http://bit.ly/1foLebI
Audrey Troutt @auditty
![Page 5: Add TDD to your Toolbox: an introduction to TDD](https://reader033.vdocuments.mx/reader033/viewer/2022051411/5476dcb5b4af9fd6028b4736/html5/thumbnails/5.jpg)
Materials needed:Source code
Unit testing frameworkUnderstanding of requirements
Audrey Troutt @auditty
![Page 6: Add TDD to your Toolbox: an introduction to TDD](https://reader033.vdocuments.mx/reader033/viewer/2022051411/5476dcb5b4af9fd6028b4736/html5/thumbnails/6.jpg)
Simple Case: There’s a bug
Audrey Troutt @auditty
![Page 7: Add TDD to your Toolbox: an introduction to TDD](https://reader033.vdocuments.mx/reader033/viewer/2022051411/5476dcb5b4af9fd6028b4736/html5/thumbnails/7.jpg)
Use Case: From the Ground Up
Audrey Troutt @auditty
![Page 8: Add TDD to your Toolbox: an introduction to TDD](https://reader033.vdocuments.mx/reader033/viewer/2022051411/5476dcb5b4af9fd6028b4736/html5/thumbnails/8.jpg)
“As the tests get more specific, the code gets more generic.”
-Uncle Bob Martin
Audrey Troutt @auditty
Read more: http://bit.ly/1Bs2h70
![Page 9: Add TDD to your Toolbox: an introduction to TDD](https://reader033.vdocuments.mx/reader033/viewer/2022051411/5476dcb5b4af9fd6028b4736/html5/thumbnails/9.jpg)
● ({}–>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
Audrey Troutt @auditty
Read more: http://bit.ly/1Bs2h70
![Page 10: Add TDD to your Toolbox: an introduction to TDD](https://reader033.vdocuments.mx/reader033/viewer/2022051411/5476dcb5b4af9fd6028b4736/html5/thumbnails/10.jpg)
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
![Page 11: Add TDD to your Toolbox: an introduction to TDD](https://reader033.vdocuments.mx/reader033/viewer/2022051411/5476dcb5b4af9fd6028b4736/html5/thumbnails/11.jpg)
“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
Audrey Troutt @auditty
Read more: http://bit.ly/1BVRR1y
![Page 12: Add TDD to your Toolbox: an introduction to TDD](https://reader033.vdocuments.mx/reader033/viewer/2022051411/5476dcb5b4af9fd6028b4736/html5/thumbnails/12.jpg)
Practice http://codekata.com/
Learn from others http://katas.softwarecraftsmanship.org/
Audrey Troutt @auditty