Write the Test First

It’s Not Easy Being Green

Kermit the Frog used to say that it’s not easy being green and he was right. In TDD we want to stay in the green as much as we can. When our tests are green life is good. Turning the red bar green can be easy at first but keeping it green can be very …

Read More
Write the Test First

Green Bar Guilty Pleasures

I’ve already written about the importance of getting to the red bar and the value of a failing test but once we get the red bar we want to move on and get to the green bar as soon as possible. In fact, turning the red bar green, which is really what TDD is all …

Read More
Write the Test First

Celebrate the Red Bar

Many important things happen getting to the red bar. In a test first approach where we write our test before we write our production code, we define the method signature before we build its implementation. That means we are thinking about how to call a method before it is written. This reinforces designing to interfaces …

Read More
Write the Test First

When Are Tests Most Valuable?

Don’t we get the most value from our tests when they fail? We may wear our seatbelt every time we get in the car but when we get into an accident and use our seatbelt is when we are most grateful for having it. This is also true with tests. It is not until a test breaks …

Read More