When it comes to a unit of code ( let’s define it as a project, service, function, script etc that performs some task) how do you define success?

An easy answer would be It fulfils its primary purpose
Each unit’s purpose, of course, differs.
But, excluding learning projects, PoCs and similar endeavors, most of our work is commissioned.
And it usually includes support and maintenance, right?

Most of us, hopefully, enjoy the building part but merely tolerate the support/maintenance part.

Focusing on that second part then, a successful unit would be

  • intuitive enough that your users require little to no support
  • robust enough that it needs little to no maintenance

So, all in all, to measure success, I’d ask

How long has it been working without you needing to think about it?