Stay green

Donald and Joe are working together to build the best prime factors decomposition function.

They want to try the TPR game so that they don’t have to deal with broken tests nor merge conflicts.

tpr = tcr && push || rebase

First they have to get familiar with this idea of TCR.

tcr = test && commit || revert

They also tweak their plumbing to include a coverage check before commit. So now the tests have to be green and the coverage must be 100% for the commit to happen or… the revert will happen. Automatic revert? Frightening!

Playing that TCR game with the prime factors kata including the coverage check proved to be full of surprises and actually great! The dead code is identified as such and triggers a code revert. Creating branches with conditional and focusing on a single one also triggers a code revert.

Now Donald and Joe want to play the TPR game so that they can work in parallel and never have to deal with code conflicts.

tpr = tcr && push || rebase

For the sake of trying this new game, let’s pretend that one will try to focus on the power of 2s and the other one will focus on the power of 3s. Let’s see what happens when they both work on the same files, which is probably the worst case scenario.

The code automatically reverts when the rebase conflicts.

The tests are always green, coverage is always 100%, no merge conflicts.

In case you want to try this custom TPR tool, it’s here.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.