From the course: Exploring Deterministic LLM Programming

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Understanding code churn

Understanding code churn

- [Instructor] Code churn turns out to be one of the most effective ways to predict defects. In a 2005 paper by Nagappan & Ball, they show that relative code churn is actually able to predict with almost 90% accuracy. So this measure is critical. When you're looking at code that has been touched by agentic systems or even legacy code, and you're trying to figure out how to improve it is run a measurement. In the case of PMAT, you can actually look at this by doing PMAT analyze churn. And you can see the churn rates. And these churn rates will then show you where you should refactor your code. And so if we take a look at this, it's really like the Penrose stairs from Escher, where you're writing the code and you keep changing it over and over again. Why is it being changed? I think this is really the five whys moment, is when you look into the code that's been modified, is it that it has some kind of subtle bug that…

Contents