2. 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
3. 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
5. 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