Why Software Devs Should Know Goodhart’s Law

Joe Rackham
2 min readJul 24, 2022
Photo by Diana Polekhina on Unsplash

I’ve been spending a lot of time at work recently on metrics, logging, and dashboards, and whilst I’ve been doing this work I’ve had Goodhart’s law in the back of my mind. If you ever do any work in a similar area I think it’s a good rule to be aware of.

Goodhart’s law is an adage that states the following:

When a measure becomes a target, it ceases to be a good measure

The best example that shows this in action is the Volkswagen emissions scandal. Volkswagen was found to have built one of its engines in such a way that it would pass the EPA’s tests despite actually being quite bad for the environment. Because the EPA reduced the attribute of ‘environmentally friendly’ to certain target metrics, those metrics were no longer useful in gauging how ‘environmentally friendly’ engines were.

A 2010 Volkswagen Golf TDI displaying “Clean Diesel”

Another example of this in the realm of technology is online news articles. The metric most articles online are evaluated against is how many people clicked to read the full text after seeing the headline. This is mostly driven by how advertising revenue works: more clicks mean more people will see the ads alongside the article. The result of this setup is the annoying style of ‘clickbait’ news articles that dominate digital media. ‘You won’t believe who's rumored to be in the next MCU film’ and so on. Without the cash incentive, one could use the clickthrough rate as a metric to evaluate whether sites were picking interesting topics to write about, but because it’s a target for writers it’s useless as a metric.

Examples of clickbait headlines

This is why I’m wary when teams identify ‘active users’ or ‘clicks’ as their measure of success. Unless the project is being evaluated more holistically you might end up making it worse. Trying to determine if an application is engaging and useful is a lot more difficult than tracking those two numbers but it’s worth the effort. Teams should invest in feedback features and user studies to get a better idea of their impact.

So next time you’re trying to evaluate what you’re working on keep Goodhart’s law in the back of your mind!

Thanks for reading, if you enjoyed this article please follow for more.

--

--

Joe Rackham

Professional Software Engineer @ Microsoft - All opinions my own