Understanding Legacy Code with TCR
Hello!
It’s been a little while. I took some time off of writing to get married in August. My wife (still weird to say) and I had a lot of fun and enjoyed some time in Napa afterward.
This week, I recorded a video at work with Kent Beck. Kent has been exploring a few ideas recently, one of them being test && commit || revert (TCR). The idea is you run this command often while developing. It gives you instant feedback. If your tests pass, the code is committed. If the tests fail, your work in progress is wiped away. This way of working sets up a lot of nice constraints, and I find it a great tool to use from time to time.
Kent and I were chatting about some code that we had found. This code that had been working for some time but did not have any tests. We recently shipped a regression to the code, so it was now under the microscope. I remarked, “We could use TCR to backfill tests and our understanding of what this code is doing.”
Kent said, “Let’s do that, and then make a video.”
Here’s the result: Understanding Legacy Code with TCR.
Until next time!
Kelly