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:
-
Write a simple test that we know will fail.
-
Write just enough code to make the test pass.
-
While the tests are passing, refactor and tidy up our code.
Press + to interact
The key is that our test should be small. It must test a single example or logic condition. And we should expect ...