Slashdot Mirror


Using Redundancies to Find Errors

gsbarnes writes "Two Stanford researchers (Dawson Engler and Yichen Xie) have written a paper (pdf) showing that seemingly harmless redundant code is frequently a sign of not so harmless errors. Examples of redundant code: assigning a variable to itself, or dead code (code that is never reached). Some of their examples are obvious errors, some of them subtle. All are taken from a version of the Linux kernel (presumably they have already reported the bugs they found). Two interesting lessons: Apparently harmless mistakes often indicate serious troubles, so run lint and pay attention to its output. Also, in addition to its obvious practical uses, Linux provides a huge open codebase useful for researchers investigating questions about software engineering."

18 of 326 comments (clear)

  1. Errors like... by Anonymous Coward · · Score: 3, Funny

    This really old Slashdot logo still in use over on Team Slashdot's page on distributed.net.

  2. Patience! by houseofmore · · Score: 5, Funny

    "...dead code (code that is never reached)"

    Perhaps it's just shy!

    1. Re:Patience! by heikkile · · Score: 2, Funny
      "...dead code "

      It's not dead - it is resting. It is pining for the fjords.

      --

      In Murphy We Turst

  3. And their other findings ... by kruetz · · Score: 5, Funny

    They also found that:

    Russian errors cause code
    Incorrect code causes errors
    Missing code causes errors
    Untested code causes errors
    Redundant codec causes redundancies
    Driver code causes headaches
    C code causes buffer overflows
    Java code causes exceptions
    Perl code causes illiteracy
    Solaris code causes rashes
    Novell code causes panic attacks
    Slashdot code causes multiple reposts
    Slashdot articles cause poor-quality posts
    Microsoft code causes exploits
    Apple code causes user cults
    Uncommented code causes code rage
    RIAA code causes computers to stop functioning
    (Poor idea causes long, desperate post)

    --

    This sig intentionally left bla... dammit!
    Who's got the whiteout?
  4. IN SOVIET RUSSIA... by Anonymous Coward · · Score: 0, Funny

    Errors find YOU! find YOU!

  5. Most prevalent source of redundant code.... by 1nv4d3r · · Score: 2, Funny

    Three letters: NIH.

    Now, if you'll excuse me, I've got to get back to my text editor project.

  6. Finding errors in your code by Amsterdam+Vallon · · Score: 3, Funny

    Isn't this the job of that smart dude down the hall who runs Lunix computers and reads some Slash Period website or something?

    Well, at least that's how I finish all my projects.

    --

    Reply or e-mail; don't vaguely moderate. Ex-O'Reilly/MIT employee, now a full-time Google employee.
  7. A good editor... by yintercept · · Score: 3, Funny

    A good editor could easily cut that article in half without loss of any information.

  8. Intentional redundant code by 1nv4d3r · · Score: 5, Funny
    I've seen this (they were fired the next month):

    // and now to boost my LOC/Day performance...
    x += 0;
    x += 0;
    x += 0;
    x += 0;
    x += 0;
    x += 0;

    It actually caused a bug 'cuz they accidentally left the '+' off one of the lines. What an idiot.

  9. Redundancy? by kubrick · · Score: 2, Funny

    Ummm... surely if any story should be duped in the near future, it's this one. Please submit story suggestions accordingly.

    --
    deus does not exist but if he does
  10. Re:redundant? by Anonymous+Hack · · Score: 1, Funny

    a=a superfluous? HOW DARE YOU! a=a is the foundation from which everything else derives! a=a proves that the only logical course of action is to TAKE! a=a is the single, most important, non-patented discovery since the wheel!

    Now, i'm off to create a new form of steel that will revolutionize the railroad industry!

    --
    I got a sig so you would remember me.
  11. PDF usually crashes my computer by Anonymous Coward · · Score: 1, Funny

    Maybe PDF has too much redundant code.

  12. Re:lint is horrible by Anonymous Coward · · Score: 1, Funny

    Stop bragging, Linus.

  13. Re:Using redundant code to find errors by nebbian · · Score: 2, Funny

    I was going to moderate this but there's no +1 Redundant.

  14. vi! by gregstoll · · Score: 4, Funny

    vi could do it!

  15. Even the smallest program... by OttoM · · Score: 2, Funny
    This is widely known:

    1. Every programs contains bugs.
    2. Every program contains redundancies and so can be made smaller without changing behavior.
    Therefore the empty program is redundant but still buggy.
  16. Re:How to Avoid Mistakes? Practical Advice? by Ed+Avis · · Score: 2, Funny

    I think it is the software version of 'zero tolerance'. Get rid of beggars and squeegee merchants and you make the more serious crimes (bugs) easier to detect and solve. Or something like that.

    --
    -- Ed Avis ed@membled.com
  17. Re:Error checking compilers by Anonymous Coward · · Score: 1, Funny

    I understand that there are non-C compilers out there that actually detect code errors without running a separate utility. Amazing!

    Silence! We will not tolerate such subversive thoughts here.