by Leon Rosenshein

More Broken Windows

I’ve talked about the Broken Windows theory before. The idea that visible signs of problems in a community, like persistent broken windows, is a leading indicator of further problems in a community. And I said that in software development problems, like frequent pages, technical debt, and failing to code for the maintainter, set precedents and lead to more of the same.

Since then, I’ve seen multiple cases where, anecdotally, that has proved true. It starts with one little thing. Then another. And another. Pretty soon, intermittent failures are ignored. Places to incorrect comments left in code. Times when, instead of simplifying a complicated conditional, more specific conditions are added.

Unfortunately, as important as individual cases and anecdotes are, as important to insights and understanding anecdotes are, they are stories. And while a story might be a singular datum, the plural of anecdote is not data. The thing is, just because there are stories and anecdotes, it doesn’t mean there’s no data. I just didn’t know of any. Until now.

According to a recently published paper, The Broken Windows Theory Applies to Technical Debt, there is now proof.

DAG showing the causal chain from paper goals to questiobs

We now have data. Not just data, but also, rigorous analysis of the data. Sure, it was a small study. 29 participants and 51 submissions. All from a small geographic region. It’s not incontrovertible, but it’s a start.

According to the paper,

The analysis revealed significant effects of TD level on the subjects’ tendency to re-implement (rather than reuse) functionality, choose non-descriptive variable names, and introduce other code smells identified by the software tool SonarQube, all with at least 95% credible intervals. Additionally, the developers appeared to be, at least partially, aware of when they had introduced TD.

Not only did the level of technical debt go up, but the participants at least partially recognized that they were adding technical debt to the code.

The study didn’t say it, but if existing tech debt is strongly correlated with more debt being added, but it stands to reason that reducing tech debt will cause a reduction in the amount of new tech debt added.

Something to think about. And act on.