TPP – Defining Obvious Implementation
If we go back to how we evolve code in TDD, we follow these three methods:
- Fake it
- Obvious implementation
- Triangulation
Faking it is a well-defined method; we just return a value that works, and this passes the test.
Triangulation is also well-defined; we just write a new failing test that forces the code to change.
However, obvious implementation is ambiguous. It may mean one thing for one developer and something else for another developer. The transformations in the following table are a way to clarify this ambiguity.
As far as we know, Robert C. Martin was the first to present the idea of evolving code in a sequence of transformations: The Transformation Priority Premise, https://8thlight.com/blog/uncle-bob/2013/05/27/TheTransformationPriorityPremise.html.
TPP Table
Figure 4.3: TPP table
Transformations at the top of the list are preferred to those at the bottom. It is better...