SlideShare ist ein Scribd-Unternehmen logo
1 von 24
“Can you make *any+ class work outside the
application? Can you get it to the point where you can
tinker with it, in real time, build it alone in less than a
second, and add tests to find out what it really does in
certain situations? (…) That's where we are in the
industry now (…) Best practices have gotten a whole
lot better in the last five years.” _ Michael Feathers

http://www.artima.com/weblogs/viewpost.jsp?thread=42486
TDD lets you take off the blindfold. Tests are a
safety net which allow us to refactor code
relentlessly without worrying about accidentally
breaking stuff.
Each test is an (executable) example which
tells you how some particular part of the
system works.
When you have tests that both document how
your code works and verifies that it does work,
you’ll spend a lot less (or no) time debugging.
“One of the most useful times to write tests is
before you start programming. When you need
to add a feature, begin by writing the test. (…)
By writing the test you are asking yourself
what needs to be done.” _ Martin Fowler


http://www.amazon.com/Refactoring-Improving-Existing-Addison-Wesley-
Technology/dp/0201485672/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1233235687
&sr=8-1
“We get a double benefit from test-first
approaches; not only do they lead us to think
deeply about design at design time, but their
legacy is a test suite that documents and
supports ongoing development of the system.”
_ Jim Webber

http://jim.webber.name/2009/01/30/83fba2cc-d1a5-4271-86a4-55e7f6b51c06.aspx
You do not talk about TDD.
You are not allowed to write any production
code unless it is to make a failing unit test
pass.



http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd
You are not allowed to write any more of a unit
test than is sufficient to fail; and compilation
failures are failures.



http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd
You are not allowed to write any more
production code than is sufficient to pass the
one failing unit test.



http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd
“Every genuine test of a theory is an attempt
to falsify it, or to refute it. (…) Confirming
evidence should not count except when (..) it
can be presented as a serious but unsuccessful
attempt to falsify [a] theory.” _ Sir Karl Popper

http://iridescence.no/post/Testability-is-Falsifiability.aspx
You can verify the resulting state of the System
Under Test (SUT), or verify the protocol of the
interactions with its collaborators.




http://benpryor.com/blog/2007/01/16/state-based-vs-interaction-based-unit-testing/
http://www.infoq.com/news/2009/01/classic-mockist-tdd
http://www.natpryce.com/articles/000342.html
1. Set up the test context
2. Exercise the SUT
3. Verify the result state (or interactions).



http://www.lostechies.com/blogs/jimmy_bogard/archive/2008/07/24/arrange-act-assert-and-bdd-specifications.aspx
The Single Responsibility Principle (SRP) applied
to testing: One test should be responsible for
verifying only one thing about the SUT. Each test
should have only one reason to fail.


http://blog.jayfields.com/2007/06/testing-one-assertion-per-test.html
http://www.ayende.com/Blog/archive/2007/08/05/What-is-one-assert.aspx
I write a failing test. Ping. You write the
necessary code to make my test pass, and
then write a new, failing test. Pong. I write
the necessary code to pass your test. Rinse
and repeat.

http://www.stickyminds.com/sitewide.asp?Function=edetail&ObjectType=COL&ObjectId=9101
http://xprogramming.com/blog/2009/01/28/pair-programming-how-important-is-it/
“Failure of the team to inspect and adapt,
especially in taking on good development
practices such as found in XP (…) can
DISABLE Scrum “ _ Ron Jeffries


http://www.scrummaster.com.au/Article.mvc/detail/48
“*The fact that+ design patterns makes code
easier to test is more proof that they actually
work, but this is just a side effect of the more
primary issue: these patterns make
programming easier... period.“ _ Scott Bellware

http://iridescence.no/post/Unit-Testing-Gives-Merit-to-Design-Patterns.aspx
“TDD forces you to (…) create better, less
coupled designs.“ _ Uncle Bob Martin




http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd
“*care about+ things that aren't just functional,
but easy to read, elegantly maintainable (…)
and sometimes flat-out sexy. A passion for
aesthetics can mean the difference between
code that others enjoy working on vs. code
that's stressful to look at.” _ Kathy Sierra

http://headrush.typepad.com/creating_passionate_users/2006/03/code_like_a_gir.html
According to a study, people procrastinate when
asked to think in the abstract, and act in a
timely way when given concrete tasks.




http://www.economist.com/science/displaystory.cfm?story_id=12971028
http://twitter.com/mfeathers/statuses/1148828932
http://www.amazon.com/xUnit-Test-Patterns-Refactoring-Addison-Wesley/dp/0131495054
http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052
http://www.amazon.com/Test-Driven-Development-Addison-Wesley-Signature/dp/0321146530/
http://www.amazon.com/gp/product/0321125215/
Test Driven Development/Design

Weitere ähnliche Inhalte

Kürzlich hochgeladen

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Kürzlich hochgeladen (20)

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Empfohlen

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Empfohlen (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Test Driven Development/Design

  • 1.
  • 2.
  • 3. “Can you make *any+ class work outside the application? Can you get it to the point where you can tinker with it, in real time, build it alone in less than a second, and add tests to find out what it really does in certain situations? (…) That's where we are in the industry now (…) Best practices have gotten a whole lot better in the last five years.” _ Michael Feathers http://www.artima.com/weblogs/viewpost.jsp?thread=42486
  • 4. TDD lets you take off the blindfold. Tests are a safety net which allow us to refactor code relentlessly without worrying about accidentally breaking stuff.
  • 5. Each test is an (executable) example which tells you how some particular part of the system works.
  • 6. When you have tests that both document how your code works and verifies that it does work, you’ll spend a lot less (or no) time debugging.
  • 7. “One of the most useful times to write tests is before you start programming. When you need to add a feature, begin by writing the test. (…) By writing the test you are asking yourself what needs to be done.” _ Martin Fowler http://www.amazon.com/Refactoring-Improving-Existing-Addison-Wesley- Technology/dp/0201485672/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1233235687 &sr=8-1
  • 8. “We get a double benefit from test-first approaches; not only do they lead us to think deeply about design at design time, but their legacy is a test suite that documents and supports ongoing development of the system.” _ Jim Webber http://jim.webber.name/2009/01/30/83fba2cc-d1a5-4271-86a4-55e7f6b51c06.aspx
  • 9. You do not talk about TDD.
  • 10. You are not allowed to write any production code unless it is to make a failing unit test pass. http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd
  • 11. You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures. http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd
  • 12. You are not allowed to write any more production code than is sufficient to pass the one failing unit test. http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd
  • 13. “Every genuine test of a theory is an attempt to falsify it, or to refute it. (…) Confirming evidence should not count except when (..) it can be presented as a serious but unsuccessful attempt to falsify [a] theory.” _ Sir Karl Popper http://iridescence.no/post/Testability-is-Falsifiability.aspx
  • 14. You can verify the resulting state of the System Under Test (SUT), or verify the protocol of the interactions with its collaborators. http://benpryor.com/blog/2007/01/16/state-based-vs-interaction-based-unit-testing/ http://www.infoq.com/news/2009/01/classic-mockist-tdd http://www.natpryce.com/articles/000342.html
  • 15. 1. Set up the test context 2. Exercise the SUT 3. Verify the result state (or interactions). http://www.lostechies.com/blogs/jimmy_bogard/archive/2008/07/24/arrange-act-assert-and-bdd-specifications.aspx
  • 16. The Single Responsibility Principle (SRP) applied to testing: One test should be responsible for verifying only one thing about the SUT. Each test should have only one reason to fail. http://blog.jayfields.com/2007/06/testing-one-assertion-per-test.html http://www.ayende.com/Blog/archive/2007/08/05/What-is-one-assert.aspx
  • 17. I write a failing test. Ping. You write the necessary code to make my test pass, and then write a new, failing test. Pong. I write the necessary code to pass your test. Rinse and repeat. http://www.stickyminds.com/sitewide.asp?Function=edetail&ObjectType=COL&ObjectId=9101 http://xprogramming.com/blog/2009/01/28/pair-programming-how-important-is-it/
  • 18. “Failure of the team to inspect and adapt, especially in taking on good development practices such as found in XP (…) can DISABLE Scrum “ _ Ron Jeffries http://www.scrummaster.com.au/Article.mvc/detail/48
  • 19. “*The fact that+ design patterns makes code easier to test is more proof that they actually work, but this is just a side effect of the more primary issue: these patterns make programming easier... period.“ _ Scott Bellware http://iridescence.no/post/Unit-Testing-Gives-Merit-to-Design-Patterns.aspx
  • 20. “TDD forces you to (…) create better, less coupled designs.“ _ Uncle Bob Martin http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd
  • 21. “*care about+ things that aren't just functional, but easy to read, elegantly maintainable (…) and sometimes flat-out sexy. A passion for aesthetics can mean the difference between code that others enjoy working on vs. code that's stressful to look at.” _ Kathy Sierra http://headrush.typepad.com/creating_passionate_users/2006/03/code_like_a_gir.html
  • 22. According to a study, people procrastinate when asked to think in the abstract, and act in a timely way when given concrete tasks. http://www.economist.com/science/displaystory.cfm?story_id=12971028 http://twitter.com/mfeathers/statuses/1148828932