Write the Actual Code
Learn to write the actual code in test-driven development.
In this step, we must write the simplest code that would allow those tests to pass. The code written may not be the perfect code, but it can be refactored later. In fact, refactoring is part of the steps involved in TDD. In short, during this step, we shouldn’t aim to write the best code. Our aim should be to write the simplest code that passes when the test is rerun.
How does it work
Recall the four tests we introduced in step one. They’re just for demonstration purposes to explain the steps involved in test-driven development.
These tests are as follows:
test_user_profile_contains_correct_html