-
3 Ways of 'Getting to Green'
2016-10-16
A part of the TDD work flow is getting a failing test to pass as quickly as possible. This makes sense if we think about how TDD is supposed to help us take smaller steps when we’re writing programs. Beck goes over three ways of getting a test to pass quickly in the fist part of TDD By Example. The first method is to fake it. Just hard code whatever values you need to to get the tests to pass.…
-
The goal of refactoring During TDD
2016-10-16
Red, green, refactor. That’s the TDD flow. That much was obvious to me. However, refactoring is a pretty broad term. There are many reasons you may want to refactor code and as a result of this, I didn’t really understand what exactly was supposed to happen during the refactor step of the TDD loop until I finished the first part of Kent Beck’s TDD by Example. Actually, in the first description of TDD, Beck uses a more helpful description of the “refactor step.…