Test Driven Development
Raihan Masud
Senior Software Engineer
Micro Systems Engineering
What is TDD
TDD is a process where you write test code before or in
parallel with the production code and your test drives the
design/development of your project.
TDD is an advanced technique of using automated unit tests
to drive the design of software and force decoupling of
dependencies. The result of using this practice is a
comprehensive suite of unit tests that can be run at any time
to provide feedback that the software is still working.
TDD is one way to think through your requirements or design
before your write your functional code
Through understanding of requirements before/at the time of coding/design
Catch early bugs that might be expensive to fix after a rigid design is done
Incremental process – write test in parallel to your code
Build confidence as you incrementally develop a feature
Run all the test all the time as you add a new test or new function to get feedback
Why TDD
How – TDD
Source: Wikipedia
TDD Simple Demo
TDD Steps
Write a test
Make it compile
Run it to see it fails
Make it Run/Pass
Refactor/Make it right
TDD Steps
Write a test
Make it compile
Run it to see it fails
Make it Run/Pass
Refactor/Make it right
TDD Steps
Source: Web
Do it Right
Resource

Presentation_TDD

  • 1.
    Test Driven Development RaihanMasud Senior Software Engineer Micro Systems Engineering
  • 2.
    What is TDD TDDis a process where you write test code before or in parallel with the production code and your test drives the design/development of your project. TDD is an advanced technique of using automated unit tests to drive the design of software and force decoupling of dependencies. The result of using this practice is a comprehensive suite of unit tests that can be run at any time to provide feedback that the software is still working. TDD is one way to think through your requirements or design before your write your functional code
  • 3.
    Through understanding ofrequirements before/at the time of coding/design Catch early bugs that might be expensive to fix after a rigid design is done Incremental process – write test in parallel to your code Build confidence as you incrementally develop a feature Run all the test all the time as you add a new test or new function to get feedback Why TDD
  • 4.
  • 5.
    TDD Simple Demo TDDSteps Write a test Make it compile Run it to see it fails Make it Run/Pass Refactor/Make it right TDD Steps Write a test Make it compile Run it to see it fails Make it Run/Pass Refactor/Make it right
  • 6.
  • 7.
  • 8.