Taking a Test Driven Development Approach

Learn what a test-driven development (TDD) approach is, the rules of the TDD approach, and why it should be followed while writing tests for Angular applications

What is TDD?

Before moving onto seeing how tests are set up within an Angular application, we need to understand what is meant by taking a Test Driven Development or TDD approach to writing code.

TDD has been around since the 1970s. The exact date when it started being used is hard to say since the practice of TDD has evolved over time as testing has grown in various languages and frameworks. And as testing became more and more important, a set of rules were agreed on for an approach on how we should write code. These rules became the base for the TDD approach.

According to the Agile Alliance, which is designed to promote Agile Development practices, and which TDD is part of (along with Sprints, Stand-ups, and pair programming), the definition of TDD is:

Test-driven development refers to a style of programming in which three activities are tightly interwoven: coding, testing (in the form of writing unit-tests), and design (in the form of refactoring).

Get hands-on with 1200+ tech skills courses.