Accurate code but inaccurate labelling is still a bug

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the dumb-mistakes-and-gotchas category.

Last Updated: 2024-11-21

After releasing the Project M (a rent calculator) on reddit, someone said it was strange because the calculator said that they would "save" money when in fact their rent could theoretically be increased.

Lesson

Even if the code outputs the correct numerical results, the labels given to those figures — i.e. the semantics of the wording in the software/HTML, can constitute a source of error. In future ask yourself, "does this wording always describe the output?"

I would also add that you ought to check that labels continue matching after refactors e.g. As part of a multi-step sign-up wizard, I moved some from fields from one page to another. This had the effect that the page title on one page now said "Location", even though there were no fields pertaining to "location" on this page anymore.

My instructions for the feature simply consisted of "move the fields", but ultimately my job is to anticipate these consequent changes too and either fix the labels myself or delegate that to the front-end team.