TCR stands for
test && commit || revert. It started as an experiment by Kent Beck. It’s a script that automatically commits or reverts whether the tests pass or fail.
TCR is the ‘natural’ evolution of TDD. Kent Beck has been arguing for a long time to
Make the change easy, then make the change
When you follow this mantra, even without TCR, most of your work becomes refactoring.
Programmers, especially juniors, often shun refactoring. We are afraid of Legacy code. We tend to look for greenfield projects, to avoid refactoring other people’s code.
Done well, I actually find Refactoring pretty rewarding. I know I’m making the lives of my teammates easier every time I improve a line of code. When all the team does it, it creates a sustainable pace, which dribbles down on all aspects of our lives.
During this summer, I’ve posted a few similar infographics. This was the last one, the next post is a longer read about maintaining a TO DO list or a Mind Map for programming.