SlideShare a Scribd company logo
TDD (Test-Driven Development)




           Zohirul Alam Tiemoon
   Coach (OOP Training Program @ BASIS)
         Email: tiemoon@gmail.com
        Blog: ztiemoon.blogspot.com


                   TDD
What is TDD (Test-Driven Development)?
Principles of TDD.

Quick Demo on TDD in Calculator.

Quick Demo on TDD in Pet Shop Application.

What is ATDD (Acceptance Test Driven Development)?

Quick Demo on ATDD in Calculator.

How does TDD/ATDD help to keep design simple?

Tools of TDD/ATDD.

Who writes Unit test code and Acceptance test code?

Why TDD/ATDD?




                                             TDD
What is TDD (Test-Driven Development)?


Principles of TDD.
Quick Demo on TDD in Calculator.

Quick Demo on TDD in Pet Shop Application.

What is ATDD (Acceptance Test Driven Development)?

Quick Demo on ATDD in Calculator.

How does TDD/ATDD help to keep design simple?

Tools of TDD/ATDD.

Who writes Unit test code and Acceptance test code?

Why TDD/ATDD?




                                             TDD
What is TDD (Test-Driven Development)?

Principles of TDD.


Quick Demo on TDD in Calculator.
Quick Demo on TDD in Pet Shop Application.

What is ATDD (Acceptance Test Driven Development)?

Quick Demo on ATDD in Calculator.

How does TDD/ATDD help to keep design simple?

Tools of TDD/ATDD.

Who writes Unit test code and Acceptance test code?

Why TDD/ATDD?




                                             TDD
What is TDD (Test-Driven Development)?

Principles of TDD.

Quick Demo on TDD in Calculator.


Quick Demo on TDD in Pet Shop App.
What is ATDD (Acceptance Test Driven Development)?

Quick Demo on ATDD in Calculator.

How does TDD/ATDD help to keep design simple?

Tools of TDD/ATDD.

Who writes Unit test code and Acceptance test code?

Why TDD/ATDD?




                                           TDD
What is TDD (Test-Driven Development)?

Principles of TDD.

Quick Demo on TDD in Calculator.

Quick Demo on TDD in Pet Shop Application.


What is ATDD (Acceptance Test-Driven Dev.)?
Quick Demo on ATDD in Calculator.

How does TDD/ATDD help to keep design simple?

Tools of TDD/ATDD.

Who writes Unit test code and Acceptance test code?

Why TDD/ATDD?




                                             TDD
What is TDD (Test-Driven Development)?

Principles of TDD.

Quick Demo on TDD in Calculator.

Quick Demo on TDD in Pet Shop Application.

What is ATDD (Acceptance Test-Driven Dev.)


Quick Demo on ATDD in Calculator.
How does TDD/ATDD help to keep design simple?

Tools of TDD/ATDD.

Who writes Unit test code and Acceptance test code?

Why TDD/ATDD?




                                             TDD
What is TDD (Test-Driven Development)?

Principles of TDD.

Quick Demo on TDD in Calculator.

Quick Demo on TDD in Pet Shop Application.

What is ATDD (Acceptance Test Driven Development)?

Quick Demo on ATDD in Calculator.


How does TDD/ATDD help to keep
design simple?
Tools of TDD/ATDD.

Who writes Unit test code and Acceptance test code?

Why TDD/ATDD?




                                             TDD
What is TDD (Test-Driven Development)?

Principles of TDD.

Quick Demo on TDD in Calculator.

Quick Demo on TDD in Pet Shop Application.

What is ATDD (Acceptance Test Driven Development)?

Quick Demo on ATDD in Calculator.

How does TDD/ATDD help to keep design simple?


Tools of TDD/ATDD.
Who writes Unit test code and Acceptance test code?

Why TDD/ATDD?




                                             TDD
What is TDD (Test-Driven Development)?

Principles of TDD.

Quick Demo on TDD in Calculator.

Quick Demo on TDD in Pet Shop Application.

What is ATDD (Acceptance Test Driven Development)?

Quick Demo on ATDD in Calculator.

How does TDD/ATDD help to keep design simple?

Tools of TDD/ATDD.


Who writes Unit test code and
Acceptance test code?
Why TDD/ATDD?




                                             TDD
What is TDD (Test-Driven Development)?

Principles of TDD.

Quick Demo on TDD in Calculator

Quick Demo on TDD in Pet Shop Application.

What is ATDD (Acceptance Test Driven Development)?

Quick Demo on ATDD in Calculator.

How does TDD/ATDD help to keep design simple?

Tools of TDD/ATDD.

Who writes Unit test code and Acceptance test code?


Why TDD/ATDD?


                                             TDD
What is TDD (Test-Driven Development)?




                 TDD
What is TDD (Test-Driven Development)?

• Is a Test-First approach (Write the test-code first
  and then write the dev-code)
• It leads to think about ‘How to use a component’
  first and then about ‘How to implement’.
• As much about design technique as testing
  technique.
• As much about (executable) documentation as
  testing.




                            TDD
Principle of TDD




       TDD
Principle of TDD

Kent Beck defines:
•    Never write a single line of code unless you
     have a failing automated test.
•    Eliminate duplication.

Red (Automated test fail)
Green (Automated test pass because dev code has been written)
Refactor (Eliminate duplication, Clean the code)




                                TDD
Principle of TDD (In Practice)



     Red



    Green



   Refactor




                     TDD
Start
Principle of TDD (In Practice)
                                 Write a Test




     Red



    Green



   Refactor




                     TDD
Start
Principle of TDD (In Practice)
                                 Write a Test

                                 Run the Test


     Red



    Green



   Refactor




                     TDD
Start
Principle of TDD (In Practice)
                                    Write a Test

                     See it fail
                  because there’s   Run the Test
                    no dev code
     Red



    Green



   Refactor




                       TDD
Start
Principle of TDD (In Practice)
                                       Write a Test

                     See it fail
                  because there’s      Run the Test
                    no dev code
     Red                             Write (just enough)
                                    Dev Code to compile


    Green



   Refactor




                       TDD
Start
Principle of TDD (In Practice)
                                       Write a Test

                     See it fail
                  because there’s      Run the Test
                    no dev code
     Red                             Write (just enough)
                                    Dev Code to compile


    Green                               Run the Test



   Refactor




                       TDD
Start
Principle of TDD (In Practice)
                                        Write a Test

                     See it fail
                  because there’s       Run the Test
                    no dev code
     Red                              Write (just enough)
                                     Dev Code to compile
                       See it fail
    Green         because no logic       Run the Test
                   is implemented


   Refactor




                       TDD
Start
Principle of TDD (In Practice)
                                        Write a Test

                     See it fail
                  because there’s       Run the Test
                    no dev code
     Red                              Write (just enough)
                                     Dev Code to compile
                       See it fail
    Green         because no logic       Run the Test
                   is implemented


   Refactor                           Write (just enough)
                                      Dev Code to pass




                       TDD
Start
Principle of TDD (In Practice)
                                        Write a Test

                     See it fail
                  because there’s       Run the Test
                    no dev code
     Red                              Write (just enough)
                                     Dev Code to compile
                       See it fail
    Green         because no logic       Run the Test
                   is implemented


   Refactor                           Write (just enough)
                                      Dev Code to pass


                                         Run the Test


                       TDD
Start
Principle of TDD (In Practice)
                                        Write a Test

                     See it fail
                  because there’s       Run the Test
                    no dev code
     Red                              Write (just enough)
                                     Dev Code to compile
                       See it fail
    Green         because no logic       Run the Test
                   is implemented


   Refactor                           Write (just enough)
                                      Dev Code to pass

                      See the
                     test pass           Run the Test


                       TDD
Start
Principle of TDD (In Practice)
                                        Write a Test

                     See it fail
                  because there’s       Run the Test
                    no dev code
     Red                              Write (just enough)
                                     Dev Code to compile
                       See it fail
    Green         because no logic       Run the Test
                   is implemented


   Refactor                           Write (just enough)
                                      Dev Code to pass

                      See the
                     test pass           Run the Test

                                          Refactoring
                       TDD
Start
Principle of TDD (In Practice)
                                        Write a Test

                     See it fail
                  because there’s       Run the Test
                    no dev code
     Red                              Write (just enough)
                                     Dev Code to compile
                       See it fail
    Green         because no logic       Run the Test
                   is implemented


   Refactor                           Write (just enough)
                                      Dev Code to pass

                      See the
                     test pass           Run the Test

                                          Refactoring
                       TDD
Quick Demo on TDD in Calculator

Tools used in this demo:
  - IDE : VS 2008
  - Language : C#
  - Unit Testing Tool: NUnit
  - Refactoring Tool: ReSharper




                             TDD
Quick Demo on TDD in Pet Shop
Story:
As a Store keeper I
want to keep a bird in
the shop (store) which
type is parrot, price is
2500 tk, color is gray
and unique id is B-001

Tools used in this demo:
   - IDE : VS 2008
   - Language : C#
   - Unit Testing Tool: NUnit
   - Refactoring Tool: ReSharper



                                   TDD
What is ATDD
(Acceptance Test-Driven Development)?




                 TDD
What is ATDD?


User Story

       Acceptance Criteria 1

       Acceptance Criteria 2

       Acceptance Criteria n
                               Acceptance Test 1

                               Acceptance Test 2

      ATDD
                               Acceptance Test n


                   TDD
Start                 What is ATDD?


   Write a Test                  Acceptance Criteria

   Run the Test


 Write (just enough)                         Automated
Dev Code to compile                          Acceptance
                                                Tests

    Run the Test


 Write (just enough)                Unit Tests
 Dev Code to pass


    Run the Test                       Deliverable
                                         Code
     Refactoring
                       TDD
Quick Demo on ATDD in Calculator

Tools used in this demo:
  - IDE : VS 2008
  - Language : C#
  - Unit Testing Tool: NUnit
  - Acceptance Testing Tool (wiki) :
  fitnesse
  -Acceptance Test Server :
  FitServer(.Net)
  - Refactoring Tool: ReSharper




                                       TDD
How does TDD/ATDD help to keep design simple?

•   Just enough design and development
•   No option of BDUF (Big design up-front)
•   Incremental design
•   Design for now not for next
•   Refactoring for improving design




                             TDD
Tools for TDD/ATDD

TDD (Unit Testing):            ATDD:
-   .Net >> NUnit              -   FIT
-   Jave >> JUnit              -   FitNesse
-   C++ >> gUnit               -   Selenium
-   Python >> PyUnit           -   Sahi
-   Ruby >> Test::Unit         -   Frankenstein




                         TDD
Who writes Unit/Acceptance Test Code?

   Unit Test:
   - Developer
     writes it.

   Acceptance Test:
   - Customer
                        Customer role can be played by:
                            - Stake holders
                            -QA
                            -Product owner
                            - Developer
                            -Business Analyst
                      TDD
Why TDD/ATDD?

• No dead code
• Simple design
• Have full-coverage test code so maintenance and
  refactoring are easy (not nightmare)
• Executable documentation
• No (or minimum) debugging




                         TDD
References
•   Kent Beck: Test-Driven Development: By Example, Addison-Wesley, 2002.
•   Test Driven .NET Development with FitNesse, Gojko Adzic
• Test-Driven Development in Microsoft .NETby James W.
  Newkirk and Alexei A. Vorontsov
•   http://www.slideshare.net/nashjain/acceptance-test-driven-development-
    350264
•   http://blogs.agilefaqs.com/
•   http://www.objectwind.com/present/FitNesse.htm
•   http://www.xprogramming.com/software.htm
•   http://testdrivendeveloper.com/
•   http://fit.c2.com/
•   http://fit.c2.com/wiki.cgi?JavaDownloads
•   http://fit.c2.com/wiki.cgi?DotNetDownloads
•   http://fitnesse.org/
•   http://sourceforge.net/projects/fitnesse



                                     TDD
Thanks to:

* Fahim Mashroor (CEO, bdjobs.com)
* Fokhruz Zaman (Cofounder & CTO of Millennium
  Information System Limited.)
* BASIS (Bangladesh Software Association & Information
   Services)




                         TDD
TDD
TDD

More Related Content

What's hot (20)

PPTX
Test Automation Framework with BDD and Cucumber
Rhoynar Software Consulting
 
PDF
Shift Left Testing: Going Beyond Agile
TechWell
 
PPTX
BDD presentation
temebele
 
PDF
Test Driven Development (TDD)
David Ehringer
 
PDF
A Not-So-Serious Introduction to Test Driven Development (TDD)
CodeOps Technologies LLP
 
PDF
Code Coverage Revised : EclEmma on JaCoCo
Evgeny Mandrikov
 
PPTX
Test-Driven Development
John Blum
 
PPTX
BDD WITH CUCUMBER AND JAVA
Srinivas Katakam
 
PDF
Jenkins Pipelines
Steffen Gebert
 
PDF
Introduction to DevOps
Ahmed Adel
 
PDF
How To Write A Test Case In Software Testing | Edureka
Edureka!
 
PDF
Test and Behaviour Driven Development (TDD/BDD)
Lars Thorup
 
PPTX
Acceptance Test Driven Development
Mike Douglas
 
PPT
Behavior Driven Development Pros and Cons
Iosif Itkin
 
PPTX
Fundamentals of DevOps and CI/CD
Batyr Nuryyev
 
PDF
An introduction to Behavior-Driven Development (BDD)
Suman Guha
 
PPTX
Test Driven Development (TDD) Preso 360|Flex 2010
guest5639fa9
 
PPT
Code coverage
Return on Intelligence
 
PDF
Bdd Introduction
Skills Matter
 
Test Automation Framework with BDD and Cucumber
Rhoynar Software Consulting
 
Shift Left Testing: Going Beyond Agile
TechWell
 
BDD presentation
temebele
 
Test Driven Development (TDD)
David Ehringer
 
A Not-So-Serious Introduction to Test Driven Development (TDD)
CodeOps Technologies LLP
 
Code Coverage Revised : EclEmma on JaCoCo
Evgeny Mandrikov
 
Test-Driven Development
John Blum
 
BDD WITH CUCUMBER AND JAVA
Srinivas Katakam
 
Jenkins Pipelines
Steffen Gebert
 
Introduction to DevOps
Ahmed Adel
 
How To Write A Test Case In Software Testing | Edureka
Edureka!
 
Test and Behaviour Driven Development (TDD/BDD)
Lars Thorup
 
Acceptance Test Driven Development
Mike Douglas
 
Behavior Driven Development Pros and Cons
Iosif Itkin
 
Fundamentals of DevOps and CI/CD
Batyr Nuryyev
 
An introduction to Behavior-Driven Development (BDD)
Suman Guha
 
Test Driven Development (TDD) Preso 360|Flex 2010
guest5639fa9
 
Code coverage
Return on Intelligence
 
Bdd Introduction
Skills Matter
 

Similar to Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Development) (20)

PPS
Test Driven Development by Sameer Arora
Xebia IT Architects
 
PDF
TDD with Ruby
Ismael G Marín C
 
PPTX
Test Driven Development
bhochhi
 
PPT
Test Driven Development
Sachithra Gayan
 
PDF
TDD reloaded - JUGTAA 24 Ottobre 2012
Pietro Di Bello
 
PPTX
Pair programming and introduction to TDD
Arati Joshi
 
PDF
TDD - A Reminder of the Principles
Matthias Noback
 
PDF
Bdd - L'arte di non farsi i fatti propri
Commit University
 
PDF
TDD Flow: The Mantra in Action
Dionatan default
 
KEY
TDD refresher
Kerry Buckley
 
DOCX
Tdd blog
nikhil sreeni
 
PPTX
Lập trình hướng kiểm thử - Test Driven development
Anh Lê
 
PDF
Real Developers Don't Need Unit Tests
John Ferguson Smart Limited
 
PDF
Bdd for legacy system
Spin Lai
 
KEY
Javascript Tests with Jasmine for Front-end Devs
Chris Powers
 
PPT
Test Driven Development - Overview and Adoption
Pyxis Technologies
 
PPTX
TDD - Test Driven Development
Tung Nguyen Thanh
 
PPTX
TDD with Visual Studio 2010
Stefano Paluello
 
PDF
Test Driven iOS Development (TDD)
Babul Mirdha
 
Test Driven Development by Sameer Arora
Xebia IT Architects
 
TDD with Ruby
Ismael G Marín C
 
Test Driven Development
bhochhi
 
Test Driven Development
Sachithra Gayan
 
TDD reloaded - JUGTAA 24 Ottobre 2012
Pietro Di Bello
 
Pair programming and introduction to TDD
Arati Joshi
 
TDD - A Reminder of the Principles
Matthias Noback
 
Bdd - L'arte di non farsi i fatti propri
Commit University
 
TDD Flow: The Mantra in Action
Dionatan default
 
TDD refresher
Kerry Buckley
 
Tdd blog
nikhil sreeni
 
Lập trình hướng kiểm thử - Test Driven development
Anh Lê
 
Real Developers Don't Need Unit Tests
John Ferguson Smart Limited
 
Bdd for legacy system
Spin Lai
 
Javascript Tests with Jasmine for Front-end Devs
Chris Powers
 
Test Driven Development - Overview and Adoption
Pyxis Technologies
 
TDD - Test Driven Development
Tung Nguyen Thanh
 
TDD with Visual Studio 2010
Stefano Paluello
 
Test Driven iOS Development (TDD)
Babul Mirdha
 
Ad

Recently uploaded (20)

PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Digital Circuits, important subject in CS
contactparinay1
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Ad

Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Development)

  • 1. TDD (Test-Driven Development) Zohirul Alam Tiemoon Coach (OOP Training Program @ BASIS) Email: [email protected] Blog: ztiemoon.blogspot.com TDD
  • 2. What is TDD (Test-Driven Development)? Principles of TDD. Quick Demo on TDD in Calculator. Quick Demo on TDD in Pet Shop Application. What is ATDD (Acceptance Test Driven Development)? Quick Demo on ATDD in Calculator. How does TDD/ATDD help to keep design simple? Tools of TDD/ATDD. Who writes Unit test code and Acceptance test code? Why TDD/ATDD? TDD
  • 3. What is TDD (Test-Driven Development)? Principles of TDD. Quick Demo on TDD in Calculator. Quick Demo on TDD in Pet Shop Application. What is ATDD (Acceptance Test Driven Development)? Quick Demo on ATDD in Calculator. How does TDD/ATDD help to keep design simple? Tools of TDD/ATDD. Who writes Unit test code and Acceptance test code? Why TDD/ATDD? TDD
  • 4. What is TDD (Test-Driven Development)? Principles of TDD. Quick Demo on TDD in Calculator. Quick Demo on TDD in Pet Shop Application. What is ATDD (Acceptance Test Driven Development)? Quick Demo on ATDD in Calculator. How does TDD/ATDD help to keep design simple? Tools of TDD/ATDD. Who writes Unit test code and Acceptance test code? Why TDD/ATDD? TDD
  • 5. What is TDD (Test-Driven Development)? Principles of TDD. Quick Demo on TDD in Calculator. Quick Demo on TDD in Pet Shop App. What is ATDD (Acceptance Test Driven Development)? Quick Demo on ATDD in Calculator. How does TDD/ATDD help to keep design simple? Tools of TDD/ATDD. Who writes Unit test code and Acceptance test code? Why TDD/ATDD? TDD
  • 6. What is TDD (Test-Driven Development)? Principles of TDD. Quick Demo on TDD in Calculator. Quick Demo on TDD in Pet Shop Application. What is ATDD (Acceptance Test-Driven Dev.)? Quick Demo on ATDD in Calculator. How does TDD/ATDD help to keep design simple? Tools of TDD/ATDD. Who writes Unit test code and Acceptance test code? Why TDD/ATDD? TDD
  • 7. What is TDD (Test-Driven Development)? Principles of TDD. Quick Demo on TDD in Calculator. Quick Demo on TDD in Pet Shop Application. What is ATDD (Acceptance Test-Driven Dev.) Quick Demo on ATDD in Calculator. How does TDD/ATDD help to keep design simple? Tools of TDD/ATDD. Who writes Unit test code and Acceptance test code? Why TDD/ATDD? TDD
  • 8. What is TDD (Test-Driven Development)? Principles of TDD. Quick Demo on TDD in Calculator. Quick Demo on TDD in Pet Shop Application. What is ATDD (Acceptance Test Driven Development)? Quick Demo on ATDD in Calculator. How does TDD/ATDD help to keep design simple? Tools of TDD/ATDD. Who writes Unit test code and Acceptance test code? Why TDD/ATDD? TDD
  • 9. What is TDD (Test-Driven Development)? Principles of TDD. Quick Demo on TDD in Calculator. Quick Demo on TDD in Pet Shop Application. What is ATDD (Acceptance Test Driven Development)? Quick Demo on ATDD in Calculator. How does TDD/ATDD help to keep design simple? Tools of TDD/ATDD. Who writes Unit test code and Acceptance test code? Why TDD/ATDD? TDD
  • 10. What is TDD (Test-Driven Development)? Principles of TDD. Quick Demo on TDD in Calculator. Quick Demo on TDD in Pet Shop Application. What is ATDD (Acceptance Test Driven Development)? Quick Demo on ATDD in Calculator. How does TDD/ATDD help to keep design simple? Tools of TDD/ATDD. Who writes Unit test code and Acceptance test code? Why TDD/ATDD? TDD
  • 11. What is TDD (Test-Driven Development)? Principles of TDD. Quick Demo on TDD in Calculator Quick Demo on TDD in Pet Shop Application. What is ATDD (Acceptance Test Driven Development)? Quick Demo on ATDD in Calculator. How does TDD/ATDD help to keep design simple? Tools of TDD/ATDD. Who writes Unit test code and Acceptance test code? Why TDD/ATDD? TDD
  • 12. What is TDD (Test-Driven Development)? TDD
  • 13. What is TDD (Test-Driven Development)? • Is a Test-First approach (Write the test-code first and then write the dev-code) • It leads to think about ‘How to use a component’ first and then about ‘How to implement’. • As much about design technique as testing technique. • As much about (executable) documentation as testing. TDD
  • 15. Principle of TDD Kent Beck defines: • Never write a single line of code unless you have a failing automated test. • Eliminate duplication. Red (Automated test fail) Green (Automated test pass because dev code has been written) Refactor (Eliminate duplication, Clean the code) TDD
  • 16. Principle of TDD (In Practice) Red Green Refactor TDD
  • 17. Start Principle of TDD (In Practice) Write a Test Red Green Refactor TDD
  • 18. Start Principle of TDD (In Practice) Write a Test Run the Test Red Green Refactor TDD
  • 19. Start Principle of TDD (In Practice) Write a Test See it fail because there’s Run the Test no dev code Red Green Refactor TDD
  • 20. Start Principle of TDD (In Practice) Write a Test See it fail because there’s Run the Test no dev code Red Write (just enough) Dev Code to compile Green Refactor TDD
  • 21. Start Principle of TDD (In Practice) Write a Test See it fail because there’s Run the Test no dev code Red Write (just enough) Dev Code to compile Green Run the Test Refactor TDD
  • 22. Start Principle of TDD (In Practice) Write a Test See it fail because there’s Run the Test no dev code Red Write (just enough) Dev Code to compile See it fail Green because no logic Run the Test is implemented Refactor TDD
  • 23. Start Principle of TDD (In Practice) Write a Test See it fail because there’s Run the Test no dev code Red Write (just enough) Dev Code to compile See it fail Green because no logic Run the Test is implemented Refactor Write (just enough) Dev Code to pass TDD
  • 24. Start Principle of TDD (In Practice) Write a Test See it fail because there’s Run the Test no dev code Red Write (just enough) Dev Code to compile See it fail Green because no logic Run the Test is implemented Refactor Write (just enough) Dev Code to pass Run the Test TDD
  • 25. Start Principle of TDD (In Practice) Write a Test See it fail because there’s Run the Test no dev code Red Write (just enough) Dev Code to compile See it fail Green because no logic Run the Test is implemented Refactor Write (just enough) Dev Code to pass See the test pass Run the Test TDD
  • 26. Start Principle of TDD (In Practice) Write a Test See it fail because there’s Run the Test no dev code Red Write (just enough) Dev Code to compile See it fail Green because no logic Run the Test is implemented Refactor Write (just enough) Dev Code to pass See the test pass Run the Test Refactoring TDD
  • 27. Start Principle of TDD (In Practice) Write a Test See it fail because there’s Run the Test no dev code Red Write (just enough) Dev Code to compile See it fail Green because no logic Run the Test is implemented Refactor Write (just enough) Dev Code to pass See the test pass Run the Test Refactoring TDD
  • 28. Quick Demo on TDD in Calculator Tools used in this demo: - IDE : VS 2008 - Language : C# - Unit Testing Tool: NUnit - Refactoring Tool: ReSharper TDD
  • 29. Quick Demo on TDD in Pet Shop Story: As a Store keeper I want to keep a bird in the shop (store) which type is parrot, price is 2500 tk, color is gray and unique id is B-001 Tools used in this demo: - IDE : VS 2008 - Language : C# - Unit Testing Tool: NUnit - Refactoring Tool: ReSharper TDD
  • 30. What is ATDD (Acceptance Test-Driven Development)? TDD
  • 31. What is ATDD? User Story Acceptance Criteria 1 Acceptance Criteria 2 Acceptance Criteria n Acceptance Test 1 Acceptance Test 2 ATDD Acceptance Test n TDD
  • 32. Start What is ATDD? Write a Test Acceptance Criteria Run the Test Write (just enough) Automated Dev Code to compile Acceptance Tests Run the Test Write (just enough) Unit Tests Dev Code to pass Run the Test Deliverable Code Refactoring TDD
  • 33. Quick Demo on ATDD in Calculator Tools used in this demo: - IDE : VS 2008 - Language : C# - Unit Testing Tool: NUnit - Acceptance Testing Tool (wiki) : fitnesse -Acceptance Test Server : FitServer(.Net) - Refactoring Tool: ReSharper TDD
  • 34. How does TDD/ATDD help to keep design simple? • Just enough design and development • No option of BDUF (Big design up-front) • Incremental design • Design for now not for next • Refactoring for improving design TDD
  • 35. Tools for TDD/ATDD TDD (Unit Testing): ATDD: - .Net >> NUnit - FIT - Jave >> JUnit - FitNesse - C++ >> gUnit - Selenium - Python >> PyUnit - Sahi - Ruby >> Test::Unit - Frankenstein TDD
  • 36. Who writes Unit/Acceptance Test Code? Unit Test: - Developer writes it. Acceptance Test: - Customer Customer role can be played by: - Stake holders -QA -Product owner - Developer -Business Analyst TDD
  • 37. Why TDD/ATDD? • No dead code • Simple design • Have full-coverage test code so maintenance and refactoring are easy (not nightmare) • Executable documentation • No (or minimum) debugging TDD
  • 38. References • Kent Beck: Test-Driven Development: By Example, Addison-Wesley, 2002. • Test Driven .NET Development with FitNesse, Gojko Adzic • Test-Driven Development in Microsoft .NETby James W. Newkirk and Alexei A. Vorontsov • http://www.slideshare.net/nashjain/acceptance-test-driven-development- 350264 • http://blogs.agilefaqs.com/ • http://www.objectwind.com/present/FitNesse.htm • http://www.xprogramming.com/software.htm • http://testdrivendeveloper.com/ • http://fit.c2.com/ • http://fit.c2.com/wiki.cgi?JavaDownloads • http://fit.c2.com/wiki.cgi?DotNetDownloads • http://fitnesse.org/ • http://sourceforge.net/projects/fitnesse TDD
  • 39. Thanks to: * Fahim Mashroor (CEO, bdjobs.com) * Fokhruz Zaman (Cofounder & CTO of Millennium Information System Limited.) * BASIS (Bangladesh Software Association & Information Services) TDD
  • 40. TDD
  • 41. TDD