Test-Driven Development Example

Learn how to practice a test-driven development workflow.

We'll cover the following

TDD workflow

Test-driven development (TDD) thrives on a fast feedback loop. As we build a new feature, we repeat a cycle of three steps:

  1. Write a simple test that we know will fail.

  2. Write just enough code to make the test pass.

  3. While the tests are passing, refactor and tidy up our code.

Get hands-on with 1400+ tech skills courses.