November 2002
Intermediate to advanced
240 pages
5h 9m
English
These patterns describe how to change the design of the system, even radically, in small steps.
In TDD we use refactoring1 in an interesting way. Usually, a refactoring cannot change the semantics of the program under any circumstances. In TDD, the circumstances we care about are the tests that are already passing. So, for example, we can replace constants with variables in TDD and, in good conscience, call this operation a refactoring, because it doesn’t change the set of tests that pass. The only circumstance under which semantics are preserved may actually be our one test case. Any other test case that was passing would fail. However, we don’t have those tests yet, so we don’t worry about them.
This “observational equivalence” ...