Transformation Priority Premise
Transformation Priority Premise is a programming approach developed by Robert C. Martin as a refinement to make the process of test-driven development easier and more effective for a computer programmer.
Transformation Priority Premise states that simpler transformations should be preferred:
This approach facilitates the programmer doing the simplest possible thing for the purposes of test-driven development as they can explicitly refer to the list of transformations and favor the simpler transformations over those further down in the list in the first instance.The Transformations
- no code at all → code that employs nil
-
- a simple constant to a more complex constant
- replacing a constant with a variable or an argument
- adding more unconditional statements.
- splitting the execution path
-
-
-
-
-
- replacing an expression with a function or algorithm
- replacing the value of a variable.
- adding a case to an existing switch or if
Uncle Bob also explicitly stated: "There are likely others".