Code Smell: What is that smell?

All software requires maintenance. What happens when one does not take care of software systems and how can one keep maintenance at a reasonable level?

Code is a perishable item. If it's not maintained and renewed, it will eventually start to smell. Code that is not covered by tests and can be considered a temporary solution is called Code Smell.

Technical debt is something that affects all software sooner or later, and debts are something that must be paid interest on. By maintaining the code, one pays off the debt, which minimizes the number of bugs and in turn reduces development costs.

Below I scratch the surface on how to avoid bad code that leads to an inferior product from Project Start to Development which then transitions to Maintenance.

Project start

Early in a project, we try to define an MVP (Minimum Viable Product), which means what the basic functionality is and just focus on that for the first release.

If you add new functionality that is beyond what can be considered part of the core functionality, you may end up with a product that is too complicated. This leads to an increase in technical debt, which in turn leads to a risk of an increased number of bugs.

Development

If you write tests while developing, you minimize the number of bugs and future-proof the code for further development, and make it easier for new developers who may take over the codebase.

Maintenance

Technology is constantly advancing, and with it, the code also needs to be renewed and changed. It might be possible to write the same functionality with much less code now than what was possible a year ago. With less code comes fewer bugs.

Photo of Mikael Hellqvist

Mikael Hellqvist

Partner & Head of Mobile