DRY fixing bugs
Being a developer we often spend more time fixing bugs than developing features(introducing new bugs 😜).
As the code evolves, bugs increase as well. We often see more bugs being added to bug backlog than being fixed in the sprint.
Bugs in production may not just cost millions of dollars but often days of the time that would rather have been spent in development.
One fine example of such a bug is Papa Musks’ PayPal accidentally credits man $92 quadrillion
Many practices such as Clean Code, Test Driven Development, Code reviews aim to minimise bugs in production. But even with these, it is almost impossible to have completely bug free systems.
More often than not we might end up fixing the same bug multiple times as the code evolves.
Let us see a few simple steps to the DRY (Do not repeat yourself) approach when fixing bugs.
Making it a habit to always cover the bugs that you have fixed with tests makes sure that the bugs never go into production again.
The test fails whenever some change causes it to break thereby enabling early detection in the CI pipeline. These tests provide a strong safety net around the code to make sure at least it doesn’t break for the same reasons. These test increase confidence in code and in yourself ensuring…