TDD Cycle
Learn the cycle of test-driven development with the help of a simple example.
TDD cycle
TDD is a three-part cycle:
- Write a test that fails.
- Get the test to pass.
- Clean up any code added or changed in the prior two steps.
Our first step is to write a test that defines the behavior we want to build into the system. In general, we seek to write the test that represents the smallest possible useful increment to the code that already exists.
Rebuilding the Profile class
For our exercise, we will rebuild the Profile
class. Let’s think about the simplest cases that can occur and write a test that demonstrates what ...
Access this course and 1400+ top-rated courses and projects.