TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

You Don't Find Bugs in Legacy Code

39 pointsby struppiover 8 years ago

10 comments

huddo121over 8 years ago
As someone that has spent the last two years migrating legacy code, I can assure you, you do find bugs in legacy code.<p>I&#x27;ve seen bugs that user&#x27;s don&#x27;t notice.<p>I&#x27;ve seen bugs that user&#x27;s have just gotten used to.<p>I&#x27;ve seen bugs where that failures it caused were dismissed as the system being a bit temperamental, for many years.<p>I&#x27;ve seen bugs that financially affected thousands of customers, and remained unnoticed over the course of several years.<p>I&#x27;ve even seen bugs that only remained because, by luck, the preconditions to trigger it had not been met.<p>I can assure you, you do find bugs in legacy code.
评论 #13461314 未加载
resfirestarover 8 years ago
Quick website comment: If you&#x27;re going to ask if I want to subscribe to your agile development course <i>and</i> your newsletter, I&#x27;d prefer if those popups came at the same time rather than several seconds apart. It&#x27;s annoying enough to get one such popup.
评论 #13461403 未加载
rwallaceover 8 years ago
&gt; None of the business analysts could remember what this statistics feature was used for, so we tried to find out who uses it. We looked at the logs of the last 6 months and found out: It was never used! Not a single time!<p>I&#x27;ve seen a lot of similar stories. General advice: if you want to find out whether anyone really uses something, the relevant time span is a year and a day. It&#x27;s theoretically possible longer would be needed, but a year and a day will cover almost all cases.
评论 #13460899 未加载
chewyfruitloopover 8 years ago
If you find a feature nobody has used for the last 6 months... and its to do with some long term calculations... probably safe to say they use it annually. We have the end of year reports that generally kill the database when people try to run 5 years worth of data through them every christmas... they never touch them during the normal working year though.
erikbover 8 years ago
It&#x27;s only mentioned in a single line, but there are a lot of real bugs in legacy code that the users actually learned to live with. It&#x27;s the software&#x27;s personality now. And when someone has learned to live with a bug, it will be missed if it is suddenly not there any more.<p>In the past I considered that a bug in human behaviour, but actually it is admirable. You give people a broken tool, but instead of failing, they find a way to succeed using that broken tool. And of course after the effort they are not as willing to change to anything else. Don&#x27;t change a running system and such.
NumberSixover 8 years ago
&quot;Legacy&quot; is a very loaded term -- generally used in a derogatory way.<p>There is an old engineering truism: &quot;if it ain&#x27;t broke, don&#x27;t fix it&quot;<p>When Lindbergh flew across the Atlantic in the Spirit of St. Louis, the Wright Aviation Company which made the engine for his plane, wanted to do its best to make sure he made it. They carefully built and checked the engine and hand delivered it with a note: &quot;don&#x27;t monkey with it&quot; (or words to that effect). Lindbergh was a careful guy and he didn&#x27;t.<p>Businesses and developers need to distinguish between warranted or needed changes to working systems (software or otherwise) and ego trips.<p>Real systems are built in limited time, with limited resources, even if they have a multi-billion dollar budget. Invariably there are things someone can make an issue about even in a system with a perfect performance record. Why did you hard code 3.14159267 instead of having a general variable for PI initialized to 3.14159267, and by the way why do you have only 8 decimal places -- wouldn&#x27;t 16 be better? It is an ego trip and it is the ancient territorial imperative, marking your territory by deprecating the previous person or team -- or a colleague.<p>Joel Spolsky wrote a famous and widely ignored blog post on this sort of thing:<p><a href="https:&#x2F;&#x2F;www.joelonsoftware.com&#x2F;2000&#x2F;04&#x2F;06&#x2F;things-you-should-never-do-part-i&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.joelonsoftware.com&#x2F;2000&#x2F;04&#x2F;06&#x2F;things-you-should-...</a><p>Take a deep breath and ask yourself: is this something we <i>really</i> need to do or am I (are we) showing off&#x2F;putting someone down&#x2F;behaving like a spoiled adolescent?
评论 #13465739 未加载
samoliover 8 years ago
So users of old software may be aware of various defects and have changed their behaviour to make it work for them. It&#x27;s important to consider the human element when &quot;fixing&quot; legacy software.
评论 #13460812 未加载
djsumdogover 8 years ago
You can&#x27;t really safely alter legacy code unless it had decent unit tests. Red&#x2F;Green programming (test drive development) is absolutely essential in cutting down on technical debt.
评论 #13460765 未加载
评论 #13460808 未加载
评论 #13460609 未加载
评论 #13460580 未加载
TorKlingbergover 8 years ago
The problem is that new code becomes legacy code about ten minutes after it is written.
WhiteSource1over 8 years ago
Hence why it&#x27;s important to unit test legacy code using a mocking tool like Typemock Isolator