An Interest In:
Web News this Week
- April 17, 2024
- April 16, 2024
- April 15, 2024
- April 14, 2024
- April 13, 2024
- April 12, 2024
- April 11, 2024
Code Smell 179 - Known Bugs
Every software has a list of known bugs. Why?
TL;DR: Don't track bugs. Fix them.
Problems
Hard to-track lists
Technical Debt
Functional Debt
Solutions
Stop calling it a Bug
Reproduce the Defect.
Cover the scenario with automation
Make the most straightforward fix (even hardcoding solutions)
Refactor
Welcome to TDD!
Context
We don't like to be interrupted.
Then, we create lists and delay fixes and solutions.
We should be able to change software easily.
We need to improve our software if we can't do quick fixes and corrections.
Not by creating To-Fix lists.
Sample Code
Wrong
<?function divide($numerator, $denominator) { return $numerator / $denominator; // FIXME denominator value might be 0 // TODO Rename function}
Right
<?function integerDivide($numerator, $denominator) { if (denominator == 0) { throw new DivideByZero(); } return $numerator / $denominator; }// we pay our debts
Detection
[X] Automatic
We need to avoid creating bugs and issues.
Tags
- Technical Debt
Conclusion
We need to discourage bugs and issue trackers on the engineering side.
Of course, customers need to track their findings and we need to address them ASAP.
Relations
More Info
Disclaimer
Code Smells are just my opinion.
Credits
Photo by Justin Lauria on Unsplash
In general, the longer you wait before fixing a bug, the costlier (in time and money) it is to fix.
Joel Spolsky
Software Engineering Great Quotes
Maxi Contieri Dec 28 '20 13 min read
This article is part of the CodeSmell Series.
Original Link: https://dev.to/mcsee/code-smell-179-known-bugs-1ieg
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To