Test-Driven Development
Explore test-driven development (TDD) to write unit tests before production code, enabling you to create software that is well-tested and maintainable. Understand the red-green-refactor workflow and the importance of designing thoughtful, high-quality unit tests that mirror your code's quality.
What is test-driven design
There's an alternative to writing tests after the code, which is writing the test prior to the code. That might be because we're starting a new project or feature, and we want to see what it will look like before writing the actual production code. Or it might be because there's a defect on the code base, and we want to write a test first to reproduce it before jumping into the fix. This is called Test-Driven Design (TDD).
There are entire books dedicated just to TDD, so it is not realistic to try and cover the topic comprehensively in this course. However, it's so important that it has to be mentioned.
The purpose of test-driven design
The idea behind TDD is that tests should be written before production ...