Change History as a Volatility Signal, and Where It Misleads

"Billing hasn't changed in years." Someone says it in every architecture review, with total confidence, and someone else quietly knows the billing module was edited last Tuesday. Human memory is a poor instrument for measuring change. The book's closing chapter proposes asking the repository instead. That idea deserves to be taken seriously, and distrusted in a few specific ways.

Why the log is a better witness than the room

In the book, volatility is a forecast: how likely a part of the system is to change in some period. Estimating it by hand, the book says, means reading history, interviewing people who know the domain and making judgement calls. Each of those inputs carries a bias. People remember what hurt recently, what they personally maintain and what made a good story. The unglamorous module that receives a small edit every other week never comes up.

Version control has no such bias. It records every change with a date and an author, and it has no opinion about which ones were memorable. The book calls historical change frequency the most direct proxy for volatility and proposes mining the log into a time series of change events per component. The practical gain is a shift in the review question, from "how volatile is this?" to "does our impression match the record?" The disagreements are where the useful conversations start.

Three ways the record misleads

A number from git feels objective, which is exactly why it needs checking. These are the failure modes I would test for first.

Commits are not changes. One commit that updates a licence header across four hundred files adds a tick to four hundred components. So does a formatter run, a dependency bump or a regenerated API client. Counted naively, frequency measures how often a file was touched, not how often its behaviour was reconsidered. The book addresses this by looking at how much changed as well as how often. You can also filter at the source, as the sketch below does.

Stable can mean feared. A file untouched for two years may be beautifully designed. It may also be the module everyone routes around because nobody understands it or the tests are missing. The log cannot tell calm from fear, and both look like zero.

The past is not next quarter. A component that was hot while a feature was built may be finished now, and a quiet one may be about to be rewritten because of next month's roadmap. How far back you look changes the answer too: a short window flatters whatever shipped long ago and punishes whatever shipped last. History reports a rate that already happened. The book goes on to propose prediction, and is candid that rigorous validation of it across many projects remains open.

A first pass you can run today

This script counts, per top-level folder pair, how many commits touched it in the last six months. It skips merge commits and any commit that touches more than forty files, on the assumption that those are mechanical.

import subprocess, collections
log = subprocess.run(
    ["git", "log", "--no-merges", "--since=6 months ago",
     "--name-only", "--format=@@%h"],
    capture_output=True, text=True, check=True).stdout
counts = collections.Counter()
for commit in log.split("@@")[1:]:
    files = [f for f in commit.split("\n")[1:] if f]
    if len(files) > 40:  # probably mechanical: skip it
        continue
    counts.update({"/".join(f.split("/")[:2]) for f in files})
for part, n in counts.most_common(15):
    print(f"{n:4}  {part}")

The threshold of forty is arbitrary, and that is the point. Every filter you add is a modelling decision that a colleague should be able to argue with. Note also that a folder is only a stand-in for a component, and a directory move splits one history into two.

There is a second hazard that no script fixes. The moment the number gates a merge or appears on a team scorecard, people will start batching their changes to keep it low.

What to do with the number

Use it to generate questions, not verdicts. Put the ranking next to the team's own picture of what is stable. Where they disagree, one of three things is true: the team's picture is out of date, the component is doing work that belongs somewhere else, or it has become the convenient place to dump every awkward change. Only a person who knows the code can say which.

Measured this way, volatility stops being a debating position and becomes evidence that can be wrong in ways you can examine. That is a real improvement over confident recollection, provided you keep asking what the record leaves out.

The takeaway

History is a witness, not a judge. It is more reliable than memory about what happened and silent about why. For how the book first measures volatility and orders components with it, read measuring volatility and ordering components. For a book tool that also draws on git history, see lvd-metrics, and for where the chapter heads next, AI-assisted refactoring and runtime adaptation.

What the book covers

  • The normalised change-frequency formula and the sliding window it is computed over
  • Weighted churn that counts interface changes more heavily than implementation changes
  • A proposed machine-learning study of future volatility: its features, model family and validation protocol
  • A real-time volatility dashboard in CI/CD that flags components drifting out of their layer's expected range