SlideShare a Scribd company logo
Test Driven Development
     Why Should You Care about TDD
      And Automated (Unit) Testing?


                Naresh Jain
            Twitter: @nashjain
      Blog: http://blogs.agilefaqs.com


         Licensed Under Creative Commons by Naresh Jain
                                                          1
Test Driven Development




TDD Rhythm - Test, Code, Refactor




                                    2
Test Driven Development

                                    Add a Test




TDD Rhythm - Test, Code, Refactor




                                                 2
Test Driven Development

                                    Add a Test



                                    Run the Test


TDD Rhythm - Test, Code, Refactor




                                                   2
Test Driven Development

                                           Add a Test

                                    Pass
                                           Run the Test


TDD Rhythm - Test, Code, Refactor




                                                          2
Test Driven Development

                                           Add a Test

                                    Pass
                                           Run the Test

                                                  Fail
TDD Rhythm - Test, Code, Refactor




                                                          2
Test Driven Development

                                            Add a Test

                                    Pass
                                           Run the Test

                                                   Fail
TDD Rhythm - Test, Code, Refactor          Make a little
                                             change




                                                           2
Test Driven Development

                                            Add a Test

                                    Pass
                                           Run the Test

                                                   Fail
TDD Rhythm - Test, Code, Refactor          Make a little
                                             change


                                           Run the Test




                                                           2
Test Driven Development

                                            Add a Test

                                    Pass
                                           Run the Test

                                                   Fail
TDD Rhythm - Test, Code, Refactor          Make a little
                                             change

                                                           Fail
                                           Run the Test




                                                                  2
Test Driven Development

                                            Add a Test

                                    Pass
                                           Run the Test

                                                   Fail
TDD Rhythm - Test, Code, Refactor          Make a little
                                             change

                                                           Fail
                                           Run the Test
                                                   Pass




                                                                  2
Test Driven Development

                                            Add a Test

                                    Pass
                                           Run the Test

                                                   Fail
TDD Rhythm - Test, Code, Refactor          Make a little
                                             change

                                                           Fail
                                           Run the Test
                                                   Pass
                                             Refactor




                                                                  2
Test Driven Development

                                            Add a Test

                                    Pass
                                           Run the Test

                                                   Fail
TDD Rhythm - Test, Code, Refactor          Make a little
                                             change

                                                           Fail
                                           Run the Test
                                                   Pass
                                             Refactor




                                                                  2
Test Driven Development

                                            Add a Test

                                    Pass
                                           Run the Test

                                                   Fail
TDD Rhythm - Test, Code, Refactor          Make a little
                                             change

                                                           Fail
                                           Run the Test
                                                   Pass
                                             Refactor




                                                                  2
Test Driven Development

                                            Add a Test

                                    Pass
                                           Run the Test

                                                   Fail
TDD Rhythm - Test, Code, Refactor          Make a little
                                             change

                                                           Fail
                                           Run the Test
                                                   Pass
                                             Refactor




                                                                  2
Why Learn TDD?


                 3
Manual (monkey) Checking by
   Developers and Tester




                              4
Stay away from (time hungry)
          debugger




                               5
Maintain Focus



                 6
Confidence




            7
Reduce Wastage: Hand Overs




                         8
Helps you
Slow down
 and Think

             9
Communication




                10
11
Ultimate Goals




                 12
Ultimate Goals


• Bring JOY back to programming




                                  12
Ultimate Goals


• Bring JOY back to programming
• Understand Code Easily




                                  12
Ultimate Goals


• Bring JOY back to programming
• Understand Code Easily
• Produce Simple, Testable, Loosely-Coupled Design




                                                     12
Ultimate Goals


• Bring JOY back to programming
• Understand Code Easily
• Produce Simple, Testable, Loosely-Coupled Design
• Build Quality In



                                                     12
Ultimate Goals


• Bring JOY back to programming
• Understand Code Easily
• Produce Simple, Testable, Loosely-Coupled Design
• Build Quality In
• Reduce Maintenance Significantly


                                                     12
Living, up-to-date
   specification




                     13
Learning:
Listen to your code



                      14
Testable Code by Design
            +
       Safety Net




                          15
Communicate Design
   Decisions




                     16
Loosely-Coupled Design




                         17
Refactoring




              18
Ultimate Goals


• Bring JOY back to programming
• Understand Code Easily
• Produce Simple, Testable, Loosely-Coupled Design
• Build Quality In
• Reduce Maintenance Significantly


                                                     19
Thank You!
      Naresh Jain
 naresh@agilefaqs.com




Licensed Under Creative Commons by Naresh Jain
                                                 20

More Related Content

What's hot (20)

ODP
xUnit and TDD: Why and How in Enterprise Software, August 2012
Justin Gordon
 
PDF
A journey to_be_a_software_craftsman
Jaehoon Oh
 
PPTX
Agile and ATDD the perfect couple
Stephen Tucker
 
PPT
Scrum and Test-driven development
toteb5
 
PDF
Atdd half day_new_1_up
jaredrrichardson
 
PPTX
ATDD in practice
Andrei Marukovich
 
PPT
Test Driven Development
guestc8093a6
 
PDF
Agile Test Driven Development
Viraf Karai
 
KEY
ATDD in Practice
Steven Mak
 
PDF
A Not-So-Serious Introduction to Test Driven Development (TDD)
CodeOps Technologies LLP
 
PDF
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Joseph Yoder
 
PPTX
Journey of atdd
Devesh Maheshwari
 
PPTX
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...
agil8 Ltd
 
PPTX
Test-Driven Development (TDD)
Brian Rasmussen
 
PDF
Agile Testing
Naresh Jain
 
KEY
Essential practices and thinking tools for Agile Adoption
Steven Mak
 
PDF
Agile Programming Systems # TDD intro
Vitaliy Kulikov
 
PDF
An Introduction to Test Driven Development
CodeOps Technologies LLP
 
PPTX
Test driven development
Nascenia IT
 
PPTX
Test Driven Development (TDD) Preso 360|Flex 2010
guest5639fa9
 
xUnit and TDD: Why and How in Enterprise Software, August 2012
Justin Gordon
 
A journey to_be_a_software_craftsman
Jaehoon Oh
 
Agile and ATDD the perfect couple
Stephen Tucker
 
Scrum and Test-driven development
toteb5
 
Atdd half day_new_1_up
jaredrrichardson
 
ATDD in practice
Andrei Marukovich
 
Test Driven Development
guestc8093a6
 
Agile Test Driven Development
Viraf Karai
 
ATDD in Practice
Steven Mak
 
A Not-So-Serious Introduction to Test Driven Development (TDD)
CodeOps Technologies LLP
 
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Joseph Yoder
 
Journey of atdd
Devesh Maheshwari
 
Agile Software Development and Test Driven Development: Agil8's Dave Putman 3...
agil8 Ltd
 
Test-Driven Development (TDD)
Brian Rasmussen
 
Agile Testing
Naresh Jain
 
Essential practices and thinking tools for Agile Adoption
Steven Mak
 
Agile Programming Systems # TDD intro
Vitaliy Kulikov
 
An Introduction to Test Driven Development
CodeOps Technologies LLP
 
Test driven development
Nascenia IT
 
Test Driven Development (TDD) Preso 360|Flex 2010
guest5639fa9
 

Viewers also liked (6)

PDF
Test-Driven Development Fundamentals on Force.com
Salesforce Developers
 
PPTX
Test Driven Development (TDD) - CVCC 2011
Tom Steele
 
PDF
Test driven development_continuous_integration
haochenglee
 
PPTX
Agil8 Agile Story Writing - Impact Mapping - David Hicks - 30 Oct 2014
agil8 Ltd
 
PDF
Test Driven Development SpeedRun
Speck&Tech
 
PPTX
Refactoring legacy code driven by tests - ITA
Luca Minudel
 
Test-Driven Development Fundamentals on Force.com
Salesforce Developers
 
Test Driven Development (TDD) - CVCC 2011
Tom Steele
 
Test driven development_continuous_integration
haochenglee
 
Agil8 Agile Story Writing - Impact Mapping - David Hicks - 30 Oct 2014
agil8 Ltd
 
Test Driven Development SpeedRun
Speck&Tech
 
Refactoring legacy code driven by tests - ITA
Luca Minudel
 
Ad

Similar to Why Test Driven Development? (20)

PDF
TDD Overview
Naresh Jain
 
PPT
Software Testing Life Cycle
gueste730d5
 
PPTX
Releasing fast code - The DevOps approach
Michael Kopp
 
PDF
Pragmatic notdogmatictdd
Joseph Yoder
 
KEY
TDD refresher
Kerry Buckley
 
PPTX
Testing
Jan Voracek
 
PDF
Avatars Of TDD
Naresh Jain
 
PDF
Avatarsoftdd 090918055018 Phpapp02
a34sharm
 
PDF
Agile Software Development Process Practice in Thai Culture
Wee Witthawaskul
 
PDF
Creating value using Agile Methods- Nanda Lankalapalli
India Scrum Enthusiasts Community
 
PDF
TAO DAYS - Process (IT session)
Open Assessment Technologies
 
PDF
TAO DAYS - Process (User session)
Open Assessment Technologies
 
PPTX
Distributed agile testing_for_enterprises
ThoughtWorks Studios
 
PDF
Continuous delivery @åf consult
Tomas Riha
 
PDF
你真的搞懂了甚麼叫敏捷式開發?
Jen-Chieh Ko
 
KEY
Introduction to Acceptance Test Driven Development
Steven Mak
 
PPTX
TDD in functional testing with WebDriver
Mikalai Alimenkou
 
PDF
Blue Monitor Systems Software Development Services
bluemonitor
 
PDF
Blue Monitor Software Development
urbantech
 
PDF
Agile - Iteration 0 CodeMash 2010
kensipe
 
TDD Overview
Naresh Jain
 
Software Testing Life Cycle
gueste730d5
 
Releasing fast code - The DevOps approach
Michael Kopp
 
Pragmatic notdogmatictdd
Joseph Yoder
 
TDD refresher
Kerry Buckley
 
Testing
Jan Voracek
 
Avatars Of TDD
Naresh Jain
 
Avatarsoftdd 090918055018 Phpapp02
a34sharm
 
Agile Software Development Process Practice in Thai Culture
Wee Witthawaskul
 
Creating value using Agile Methods- Nanda Lankalapalli
India Scrum Enthusiasts Community
 
TAO DAYS - Process (IT session)
Open Assessment Technologies
 
TAO DAYS - Process (User session)
Open Assessment Technologies
 
Distributed agile testing_for_enterprises
ThoughtWorks Studios
 
Continuous delivery @åf consult
Tomas Riha
 
你真的搞懂了甚麼叫敏捷式開發?
Jen-Chieh Ko
 
Introduction to Acceptance Test Driven Development
Steven Mak
 
TDD in functional testing with WebDriver
Mikalai Alimenkou
 
Blue Monitor Systems Software Development Services
bluemonitor
 
Blue Monitor Software Development
urbantech
 
Agile - Iteration 0 CodeMash 2010
kensipe
 
Ad

More from Naresh Jain (20)

PDF
Problem Solving Techniques For Evolutionary Design
Naresh Jain
 
PDF
Agile India 2019 Conference Welcome Note
Naresh Jain
 
PDF
Organizational Resilience
Naresh Jain
 
PDF
Improving the Quality of Incoming Code
Naresh Jain
 
PDF
Agile India 2018 Conference Summary
Naresh Jain
 
PDF
Agile India 2018 Conference
Naresh Jain
 
PDF
Agile India 2018 Conference
Naresh Jain
 
PDF
Agile India 2018 Conference
Naresh Jain
 
PDF
Pilgrim's Progress to the Promised Land by Robert Virding
Naresh Jain
 
PDF
Concurrent languages are Functional by Francesco Cesarini
Naresh Jain
 
PDF
Erlang from behing the trenches by Francesco Cesarini
Naresh Jain
 
PDF
Anatomy of an eCommerce Search Engine by Mayur Datar
Naresh Jain
 
PDF
Setting up Continuous Delivery Culture for a Large Scale Mobile App
Naresh Jain
 
PDF
Towards FutureOps: Stable, Repeatable environments from Dev to Prod
Naresh Jain
 
PDF
Value Driven Development by Dave Thomas
Naresh Jain
 
PDF
No Silver Bullets in Functional Programming by Brian McKenna
Naresh Jain
 
PDF
Functional Programming Conference 2016
Naresh Jain
 
PDF
Agile India 2017 Conference
Naresh Jain
 
PDF
The Eclipse Way
Naresh Jain
 
PDF
Unleashing the Power of Automated Refactoring with JDT
Naresh Jain
 
Problem Solving Techniques For Evolutionary Design
Naresh Jain
 
Agile India 2019 Conference Welcome Note
Naresh Jain
 
Organizational Resilience
Naresh Jain
 
Improving the Quality of Incoming Code
Naresh Jain
 
Agile India 2018 Conference Summary
Naresh Jain
 
Agile India 2018 Conference
Naresh Jain
 
Agile India 2018 Conference
Naresh Jain
 
Agile India 2018 Conference
Naresh Jain
 
Pilgrim's Progress to the Promised Land by Robert Virding
Naresh Jain
 
Concurrent languages are Functional by Francesco Cesarini
Naresh Jain
 
Erlang from behing the trenches by Francesco Cesarini
Naresh Jain
 
Anatomy of an eCommerce Search Engine by Mayur Datar
Naresh Jain
 
Setting up Continuous Delivery Culture for a Large Scale Mobile App
Naresh Jain
 
Towards FutureOps: Stable, Repeatable environments from Dev to Prod
Naresh Jain
 
Value Driven Development by Dave Thomas
Naresh Jain
 
No Silver Bullets in Functional Programming by Brian McKenna
Naresh Jain
 
Functional Programming Conference 2016
Naresh Jain
 
Agile India 2017 Conference
Naresh Jain
 
The Eclipse Way
Naresh Jain
 
Unleashing the Power of Automated Refactoring with JDT
Naresh Jain
 

Recently uploaded (20)

PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 

Why Test Driven Development?