Rules of TDD:
Transformation Priority Premise (TPP) suggests what could be the next change in the algorithm to make the next failing test pass. It was suggested by Uncle Bob here: https://blog.cleancoder.com/uncle-bob/2013/05/27/TheTransformationPriorityPremise.html
The most important thing in TPP is that it helps production code to change from specific to generic.
When we use TDD, our production code goes through a sequence of transformations. I used to think it was a transformation from stupid to intelligent. But I’ve begun to see that this is not the case at all. Rather, the code goes through a sequence of transformations from specific to generic.
Based on TDD Uncle Bob suggested to amend rules of TDD into the following form:
If we accept the Priority Premise, then we should amend the typical red-green-refactor process of TDD with the following provision:
*1) When passing a test, prefer higher priority transformations.
Below is the short cheatsheet for TPP.