Test Driven Design
TDD is an important agile requirements and agile design technique.
In normal Testing process, we first generate the code and then test. But in TDD approach we write Test first and let the Test fail. In order to pass the test, the team has to develop and refactors the code. Refactoring a code involves changing some code without affecting its behavior.
There are two levels of TDD.
- Acceptance TDD (ATDD) / Behavior Driven Development (BDD)
- Developer TDD
Content for TDD in Angular
As in TDD we write unit test first, we might find a lot of our code is hard to test. The best strategy is often to refactor code to make it easy to test. For example, consider refactoring component code into services and focusing on service tests or vice versa.