Slashdot Mirror


The Economics of Perfect Software

An anonymous reader writes "This article takes the interesting perspective that leaving bugs in software is good — little ones, at least. This quote is particularly insightful: 'How do you know whether a bug is big or little? Think about who's going to hit it, and how mad they'll be when they do. If a user who goes through three levels of menus, opens an advanced configuration window, checks three checkboxes, and hits the 'A' key gets a weird error message for his trouble, that's a little bug. It's buried deep, and when the user hits it, he says 'huh,' clicks a button, and then goes on his merry way. If your program crashes on launch for a common setup, though, that's a big bug. Lots of people will hit it, and they will all be pissed. ... The cost of fixing all the bugs in your program and then being sure you fixed them all is way too high compared to the cost of having a few users hit some bugs they won't care about."

38 of 201 comments (clear)

  1. How is this news? by Dragoniz3r · · Score: 5, Insightful

    Diminishing returns applies to programming too... big surprise...

    1. Re:How is this news? by Jurily · · Score: 3, Interesting

      Diminishing returns applies to programming too... big surprise...

      But you don't know how much each bug will cost. What if that little UI glitch gives remote root?

      BTW Joel Spolsky said the same in 2001. Big fucking news indeed.

    2. Re:How is this news? by siride · · Score: 4, Funny

      Then I would say that's a big bug, so it should be fixed.

    3. Re:How is this news? by obarel · · Score: 4, Insightful

      I hope you're not serious.

      The first problem is that it doesn't guarantee anything. There are very few software companies that close down or get rid of people because of small quirky bugs. You're not going to lose your job simply because you write perfect code either...

      The second problem is that if you do keep your job, it's only to maintain the same piece of code. Aren't there more exciting things to do than to fix the same bugs you left in some spaghetti code that only you can understand? Isn't it better to write good solid readable code and move on to more interesting problems than off-by-one bugs you left on purpose?

      And the third problem is that you can never justify that to your boss: "You've got to keep me because the code is terrible and only I can maintain it". The easiest thing would be to cut the losses and send you free, only to bring someone who can write some code that isn't an expensive liability.

      Sadly, you're not the only person that writes bad code for "job security". So I hope your post gets a "Score: 5 Funny" and not a "Score: 2 Insightful"...

    4. Re:How is this news? by Vellmont · · Score: 4, Insightful


      What if that little UI glitch gives remote root?

      Then you're an idiot who didn't separate your software properly into layers and should learn, or get out.

      I understand your example, but the ultimate fear you're expressing about "the unknown" isn't warranted. Software is complex and can lead to unexpected problems. But worrying about every single minor bug possibly being a major one is just silly if you understand how the system interacts with itself. That's why good software is developed in layers. If you've really got a system where a UI glitch leads to a root exploit, time to throw away the whole application and start over.

      --
      AccountKiller
    5. Re:How is this news? by spongman · · Score: 4, Interesting

      yeah, there's a also a mistaken suggestion that there's a correlation between the severity of the bug and the cost of fixing it.

      in general there isn't.

      you might have a crashing, data-destroying bug that's trivial to fix. or you might have a minor UI annoyance that would require a complete re-write in order to fix, possibly introducing a whole slew of new bugs.

      unless you have a deep understanding of the architecture of the application, there's absolutely no way to judge which class a given bug is in.

  2. Lets look at it another way by Anonymous Coward · · Score: 3, Insightful

    You cant afford perfect software.

    1. Re:Lets look at it another way by Tablizer · · Score: 2, Informative

      You cant afford perfect software.

      Unless you are NASA:

      http://www.fastcompany.com/magazine/06/writestuff.html
           

    2. Re:Lets look at it another way by sopssa · · Score: 4, Interesting

      Quote from the site:

      Consider these stats : the last three versions of the program -- each 420,000 lines long-had just one error each. The last 11 versions of this software had a total of 17 errors.

      So yes, they have errors too and their software isn't perfect nor bug-free. But their acceptable cost versus bug-free threshold is just a lot more higher than usual software. Exactly what the summary and article is about.

  3. Oh Please by WrongSizeGlass · · Score: 5, Insightful

    The reason that every piece of software ships with bugs is because:
    * It's created by people
    * The programmers, testers, etc can never find all the bugs
    * It's gotta get out the door so you can pay your programmers, testers, etc
    * All of the above

    There is a matter of pride with individual programmers, small groups, and most open source programming projects. We'd all love to be able to crow about shipping a bug free project/product. We'd do it if we could ... and someday we will.

    1. Re:Oh Please by zappepcs · · Score: 4, Insightful

      Exactly. Most coders have to use the code they write. Leaving bugs is not something you do if you know they are there. Sure some people do that, but not the ones that want to get it right - at least for their own use. This is why some open source software is not infinitely usable - it did what the original author needed, and was not intended particularly to solve everyone's silly problems. The example of the 'A' key is probably something that was going to work soon, but the need for it never materialized and someone forgot to disable the code that checks for the letter 'A' - and since it was not implemented, nobody checked it.

      The first time I had code in production, running 24/7 I was kind of upset that I didn't need to look at it everyday, then amazed that it was working so well. Then, months later when I did have to go look at why it seemed to be not working right, I learned how important documentation and comments are. At this point I stopped being amazed that it worked well, but that it worked at all. Bugs are not left on purpose, only when there is not time or resources to fix them.

    2. Re:Oh Please by WrongSizeGlass · · Score: 5, Insightful

      even as individuals with all of our time at our discretion we would not waste the rest of lives trying to get the bugs out of something as complex as modern software, so NO we won't do it SOMEDAY either.

      We may not ever accomplish it, but that doesn't mean we won't stop trying. Bugs slip through no matter how much we test. One reason is because no matter how we may try to break it we can never imagine the utterly creative stupidity that a user will cast upon our software.

      And as far as Skynet is concerned, it will be written by humans or by a system written by humans, so it's gonna have bugs, too (unless it was written by Deep Thought, but that's another story entirely).

    3. Re:Oh Please by Jurily · · Score: 4, Insightful

      Leaving bugs is not something you do if you know they are there.

      Depends on how much of the code you have to refactor to get rid of it, how many users are annoyed at that particular bug in the previous release, and how many new users you'd get by implementing the most asked-for feature instead.

      You probably won't fix the bug where your text editor crashes if the user tries to open a file larger than 32 Gb first, if they've been also nagging you for global replace functionality.

    4. Re:Oh Please by Vellmont · · Score: 2, Insightful


      Most coders have to use the code they write. Leaving bugs is not something you do if you know they are there. Sure some people do that, but not the ones that want to get it right

      This happens all the time. Have you never read release notes that have a list of "known bugs"? Generally that's open source software. The closed source software has the exact same list, it just exists on the software makers private network.

      Sure, if you KNOW how to fix the bug and it's easy most people will just fix it. The other cases it depends on the economics. Open source software isn't any different than closed source in this respect. Resources are always finite whether they're money or time.

      --
      AccountKiller
    5. Re:Oh Please by Tablizer · · Score: 3, Funny

      The reason that every piece of software ships with bugs is because:...It's created by people...

      I'm breeding cockroaches to write code. How ironic: bugs will solve bugs.
         

    6. Re:Oh Please by gyrogeerloose · · Score: 2, Insightful

      I doubt that that will happen. Anything made by a human has a flaw.

      Yeah, but it's one of those infinite-number-of-monkeys-for-an-infinite-amount-of-time things. Enough programmers writing enough code for enough time will, more or less by accident, write a perfect piece of code.

      --
      This ain't rocket surgery.
    7. Re:Oh Please by scamper_22 · · Score: 2, Interesting

      The other thing that might be a possibility... is that software needs to have bugs from the business end to ensure lucrative service contracts.

      Now this is just pure speculation of course... but I used to a work for networking vendor known for superior customer support... and making mega bugs in the servicing contracts as well.
      I sat there looking at some ridiculous policies in the software realm that almost seemed to encourage bugs in the code as opposed to writing good software.

      They were throwing code around to various teams... seemed to value programmers who could be tossed onto a project instead of those who wrote good software...

      I left... not my kind of place... I don't like being a janitor cleaning up everything... but lately... I've gone more into technical project management. You know what customers love... they love seeing lots of engineers giving them attention.
      So it got me thinking if such policies to encourage buggy software are not just stupid policies, but actually active management policies... to ensure customers are willing to pay for lofty service contracts.
      Get something that works reasonably well to get things working... but make sure the bug fixing phase never ends... and you never lose service contracts.
      You never just sell a piece of hardware... like a spoon.

    8. Re:Oh Please by acecamaro666 · · Score: 3, Insightful

      Not true. Infinite number of programmers and an infinite amount of time just means an infinite number of bugs.

    9. Re:Oh Please by Hotawa+Hawk-eye · · Score: 2, Insightful

      One reason is because no matter how we may try to break it we can never imagine the utterly creative stupidity that a user will cast upon our software.

      That's one factor; but another larger factor is that there are often several orders of magnitude more users of your software than there are testers. Even if the testers were able to come up with all the "utterly creative stupidity" as the users, there wouldn't be enough hours in the day for them to test all those cases.

  4. Well, sure, if you have precognition by Geoffrey.landis · · Score: 4, Insightful

    Well, sure, except that this assumes that you are PERFECT in your ability to predict the effect of a bug. And if you're not, that bug that you think will only happen in some situation that's vastly improbably will, in fact, actually hit at exactly the WORST possible time, because maybe that key sequence gets used in some extremely important operation that you hadn't realized your software was going to be used for. Or maybe that bug is ALSO triggered by some different sequence that you weren't quite prescient enough to realize would be common.

    --
    http://www.geoffreylandis.com
  5. probably good idea; definitely bad example by pem · · Score: 3, Insightful

    If a user who goes through three levels of menus, opens an advanced configuration window, checks three checkboxes, and hits the 'A' key gets a weird error message for his trouble, that's a little bug.

    When I'm trying very hard to make a program do what I want it to, the more hoops I have to jump through for every iteration of trying to make it work, the madder I get. So, the fact that the software has dark corners that you can get to like this is already a major strike against it...

    1. Re:probably good idea; definitely bad example by WrongSizeGlass · · Score: 4, Funny

      The only way of eliminating those dark corners is by eliminating them.

      And today's Yogi Berra award goes to hedwards. We'd like to thank everyone who participated for participating and the winner for winning.

    2. Re:probably good idea; definitely bad example by pem · · Score: 5, Funny
      When I wrote:

      When I'm trying very hard to make a program do what I want it to, the more hoops I have to jump through for every iteration of trying to make it work, the madder I get.

      then you replied:

      You must be a Windows user or haven't updated to an Apple OS past the old world Macs.

      I have been racking my brain for the last half hour, trying to figure out what I wrote that bothered you so much that you felt compelled to resort to this sort of name-calling, but I can't figure it out, so expect a communication from my lawyer demanding compensation for this terrible libel you have committed about my computing practices in front of the entire slashdot community.

  6. Dangerous approach by mmmmbeer · · Score: 4, Insightful

    This sounds a lot like the "Good Enough Software" policies that certain companies used to have. It's true that having a few minor bugs is acceptable; in fact, it's pretty much inevitable. But you should expect to have bugs that you haven't even noticed at the time you ship your software. If you start ignoring the bugs you do know about, you increase the total number considerably. From there, it's a slippery slope. Pretty soon, you'll be answering bug reports with a chorus of "Minor, leave it," and your code will be riddled with tons of minor bugs. Your users will go from "huh" to "what?" to "dammit" to "f*ck this!" Your software will look sloppy and unprofessional, and even if none of the bugs are showstoppers, your customers will be looking for alternatives.

  7. Maybe. by Junior+J.+Junior+III · · Score: 3, Insightful

    The cost of fixing all the bugs in your program and then being sure you fixed them all is way too high compared to the cost of having a few users hit some bugs they won't care about.

    I think it also depends on how much it costs to remove the bugs. Often times, the small bugs that people are more likely to accept or tolerate are also very easy to fix. When the cost of fixing the bug is very low, it should be a no-brainer to do it. If on the other hand the bug is expensive to fix -- requiring a complete redesign and re-coding, then if the bug is not severe it may well be better to leave it in.

    --
    You see? You see? Your stupid minds! Stupid! Stupid!
  8. I'm not sure I buy the argument by Palestrina · · Score: 2, Insightful

    Software is not so different from other engineering disciplines that we cannot learn from the best practices of adjacent fields. Although no human endeavor -- other than being Pope -- is infallible, we do see disciplined attempts to measure, manage and improve quality levels. The point is not to reduce the quality level to zero, but to know what your quality level is and be able to hit your mark. What level of quality is needed will depend on the market, your customers, the competition, the frequency of releases, whether the software is easily updated or burned into firmware and devices, etc.

    In the end, the best way to create higher quality software is not to find and fix more bugs. It is to use a disciplined approach to programming that introduces fewer bugs in the first place. If you focus on defect detection and removal, then you are fighting the wrong battle. You can't win doing it that way. Quality software comes from a disciplined process at all stages, from requirements to testing, and not just as an endgame activity to sway as many bugs as you can.

  9. Re:Wrong name by betterunixthanunix · · Score: 2, Funny

    int main()
    {
    printf("Hello, world");
    return 0;
    }

    I demand your first born.

    --
    Palm trees and 8
  10. If they need it, and it's buggy, it's annoying by Tsu+Dho+Nimh · · Score: 3, Insightful

    ... a user who goes through three levels of menus, opens an advanced configuration window, checks three checkboxes, and hits the 'A' key gets a weird error message for his trouble

    Is going to be one extremely unhappy user because they had a reason for going that deep into the sub-cellars of the software to get at that obscure feature ... and it is likely that they are the sport of user who is a bit more tech-savvy and ready to bitch than Joe Average user.

    1. Re:If they need it, and it's buggy, it's annoying by mikael_j · · Score: 2, Insightful

      How about we pretend that the user actually wants to use the feature to avoid analogies along the lines of "It's like saying a car is acceptably broken if the engine explodes when you turn on the radio since we can assume the driver had no intention of actually using the radio, that's just an obscure extra feature that no one uses..."...

      --
      Greylisting is to SMTP as NAT is to IPv4
  11. The core argument does make sense. by Max+Romantschuk · · Score: 2, Informative

    Sometimes it's better to ship a product and deliver it to 95% of the user base instead of having everyone wait because 5% wants feature X which is broken.

    But there is the option to disable feature X, so rather than knowingly ship with bugs you can often have the program show a notice that this feature is disabled or something like that.

    Generally when building software you'll have "Quickly", "Lots of features" and "Bug free". Depending on the software and project stage you'll want to strike a different balance. Releasing an alpha which has lots of features quickly with loads of bugs is OK. Releasing a final release of a program handling financial transactions with loads of bugs is never OK.

    But yes, it's a question of economics, and what makes sense for a given project at a given time.

    --
    .: Max Romantschuk :: http://max.romantschuk.fi/
  12. sometimes crash == possible exploit by Eponymous+Coward · · Score: 4, Insightful

    It isn't always easy to judge the severity of bugs. Exploits often grow from a black hat figuring out how to crash a program. Some of the greatest exploits started with the smallest of footholds.

  13. Re:Wrong name by The+Clockwork+Troll · · Score: 5, Funny

    You didn't include stdio.h and you probably wanted a \n at the end of your output string.

    First born denied.

    --

    There are no karma whores, only moderation johns
  14. Re:Wrong name by betterunixthanunix · · Score: 4, Funny

    In C you can implicitly declare functions! I demand at least half of your firstborn.

    --
    Palm trees and 8
  15. mediocrity by electrogeist · · Score: 5, Insightful

    "Once genius is submerged by bureaucracy, a nation is doomed to mediocrity. " -Richard Nixon

    s/nation/project/

  16. No bugs isn't a perfect product. by ArundelCastle · · Score: 5, Insightful

    Even if it's bug free, that doesn't mean the software is designed to be easy or intuitive to use. There is often more money to be made from deliberate obfuscation. Every piece of Enterprise software I've used (particularly SAP) seems to follow this principle. And the huge aftermarket of expert consultants charging $150/hr for training and troubleshooting, seems to affirm it. Keep in mind those consultants are usually teaching the corporate experts, I'm not even touching the surface of end user training, which I'm experienced at being responsible for.

    The real money comes from support packages and direct-line support levels (ie: silver, gold, platinum and such to maintain a 24h call centre). Let's ask a simple hypothetical: what if Windows was bulletproof and bug free? How would Microsoft make any money? If nobody had reason to fix a problem within 30 minutes like their job depends on it? Or even not upgrade to the next version because the last one works better? With XP and Vista we already know the answer to that.

  17. Obscure bugs can be fatal ones. by Garrett+Fox · · Score: 4, Informative

    The post talks about minor bugs being the ones that are hard to reach, but that's not necessarily the case. There was a piece of radiation-beam hardware used for cancer treatment (the Therac-25), that became a case study in engineering because of a literally fatal flaw. It was possible to mis-configure the machine so that it struck the patient with a much more powerful radiation beam than was normally allowed. The relevant point was, this situation only happened if the operator did some obscure, seemingly unlikely combination of actions that would result in a lead plate getting misaligned or something. Yet it happened at least six times, killing at least two people. The fact that the bug was caused by this particular sequence of actions made it that much harder to identify -- and it was not a minor bug worth ignoring.

    --
    Revive the Constitution.
  18. Re:You sure about that? by mikestew · · Score: 2, Insightful

    Programs run just fine, or so some hope, with compiler warnings. Despite that, parent says his shop considers them to be bugs.

    Oh to work in such a shop, where I don't have to sift through 74 warnings every build because someone decides that catch (Exception e) is fine even if you never take so much as a passing glance at what got put into variable e. Hey, dev manager, how about you just turn the fsckin' things off if no one cares?

  19. Re:triaging incompetence by Vellmont · · Score: 2, Interesting


    The economic angle is a dangerous meme, because it lets incompetent management off the hook by allowing them to triage incompetence, and in particular, to ignore process failures, and the failure of team culture, both of which point back to management itself. We all know how well that worked out for NASA. This wasn't fixed until lives were lost.

    If you're writing code for NASA, or say the medical industry, I'd agree. But 99.9% of the developers out their are writing code that nobody is ever going to die because of a bug. If you tried to apply the same standards to business software that you do to Nasa or medical software, nothing would ever get done.

    As far as a "culture of incompetence" is concerned, and triaging bugs, I don't see the two as terribly connected. There's always going to be bugs, and some of them are going to be minor. This will happen even if you have the best developers in the world. Accepting bugs doesn't mean you give up on quality, or don't look to improve your process. It can actually be PART of that process. You assume all bugs come from "incompetence" or "process failure", or something wrong with the system. That's just silly. People aren't perfect. Hell, machines aren't perfect. The perfect is the enemy of the good, as the saying goes.

    --
    AccountKiller