skip to main content

gerg.dev

Blog | About me

What you’re saying in a commit without tests

A corollary to last week’s post:

A commit without a test can effectively be read as “It would be okay if somebody undid this, even unintentionally.

Sometimes that’s actually what you want; it might be inconsequential or a rapidly changing aspect or some internal implementation detail. You might be saying “this doesn’t directly impact the business” or “this changing wouldn’t seriously negatively impact me or my team”.

Sometimes it’s not what you want but conditions require it; perhaps it reflects some subtle issue that isn’t readily testable with automation or with the resources available. You might be saying “the risk of this being undone is outweighed by the cost of preventing it” or “the risk of this being undone needs to be mitigated elsewhere.”

More likely, developers (myself included) don’t really think about it in these terms most of the time. We operate on the hope and confidence that nobody would be stupid enough to undo it deliberately; that nobody would make a mistake that would undo it accidentally; and that we would catch it if they did.

With your next commit, what are you saying?

About this article

Leave a Reply