Transformation Priority Premise
Transformation Priority Premise (TPP) is a programming approach developed by Robert C.
≈ 2 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
Transformation Priority Premise (TPP) is a programming approach developed by Robert C. Martin (Uncle Bob) as a refinement to make the process of test-driven development (TDD) 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 (from the top of the list) over those further down in the list in the first instance.
The Transformations
Source: ({} → nil) no code at all → code that employs nil (nil → constant) (constant → constant+) a simple constant to a more complex constant (constant → scalar) replacing a constant with a variable or an argument (statement → statements) adding more unconditional statements. (unconditional → if) splitting the execution path (scalar → array) (array → container) (statement → tail-recursion) (if → while) (statement → non-tail-recursion) (expression → function) replacing an expression with a function or algorithm (variable → assignment) replacing the value of a variable.
(case) adding a case (or else) to an existing switch or if Robert Martin also explicitly stated: "There are likely others", and
References
Roman Numerals Kata with Commentary Transformation Priority Premise Applied The Transformation Priority Premise explained by Uncle Bob
External links
Bob Martin's original blog post on TPP A subsequent blog post in which Bob Martin extended the list of transformations
Text derived from https://en.wikipedia.org/w/index.php?oldid=1324169665 under CC BY-SA 4.0; modifications have been made.